我在 fxml 文件中声明了一些 JavaFX 组件。
以及如何在按下按钮时获取字段(用户名、密码)的值?(执行登录)。
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
stage.setTitle("Login");
stage.setScene(new Scene(root,400,300));
stage.show();
Run Code Online (Sandbox Code Playgroud)
或者这是完全错误的方法吗?
我的问题:
编辑:https : //hastebin.com/qexipogoma.xml <- 我的 FXML 文件和我的控制器