JavaFx - Opening an FXML file in New Window
156 بار بازدید -
6 سال پیش
-
This video shows how to
This video shows how to launch an FXML layout in a new window in JavaFX. When the user clicks on a button, a new Window will be opened.
For this, we need two separate FXML layout files. First one is for the main window and second one is for the new window. Here is the code for loading new Window.
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("Demo.fxml"));
Parent root1 = (Parent) fxmlLoader.load();
Stage stage = new Stage();
stage.setScene(new Scene(root1));
stage.show();
Supp
6 سال پیش
در تاریخ 1397/04/03 منتشر شده
است.
156
بـار بازدید شده