我正在试图弄清楚如何使用JavaFx.我在Scene Builder中构建了应用程序界面.但我无法访问该组件,因为所有组件都加载到Parent中.
Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
Run Code Online (Sandbox Code Playgroud)
如果我在"Pane"上更改"Parent",我可以访问getChildren(),但如果我知道fx:id,则不清楚如何获得控制权...
问题更简单.我在Scene Builder中添加了Label或TextField.如果我知道fx:id,如何从代码中更改它的文本?
我绝望了.