小编And*_*rew的帖子

无法确定按钮的宽度,因为 JavaFx 中 getWidth() 返回 0

我正在开发一个必须显示树的应用程序。我从: JavaFX 中的图形可视化(如 yFiles)开始。树会显示,但对于调用 getWidth 方法或 getBoundsInLocal、getBoundsInParent、getLayoutBounds 的任何变体的 ButtonCell,getLayoutBounds 返回 0,而 getPrefWidth 返回 -1。

如何获取按钮的宽度和高度?

javafx

1
推荐指数
1
解决办法
6362
查看次数

标签 统计

javafx ×1