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