📜  javafx 访问 fxml 元素 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:40.334000             🧑  作者: Mango

代码示例1
Scene scene = stage.getScene();
//capture elements by their #id: 
Button btn = (Button) scene.lookup("#myBtnID");
TextField txt = (TextField ) scene.lookup("#myTxtID");