Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package application;
- import javafx.application.Application;
- import javafx.fxml.FXMLLoader;
- import javafx.stage.Stage;
- import javafx.scene.Scene;
- import javafx.scene.layout.AnchorPane;
- public class Main extends Application {
- private Stage primaryStage;
- @Override
- public void start(Stage primaryStage) {
- this.primaryStage = primaryStage;
- mainWindow();
- }
- public void mainWindow() {
- try {
- FXMLLoader loader = new FXMLLoader(Main.class.getResource("MainWindowsController.fxml"));
- AnchorPane pane = loader.load();
- MainWindowsController mainWindowController = loader.getController();
- mainWindowController.setMain(this);
- Scene scene = new Scene(pane);
- primaryStage.setScene(scene);
- primaryStage.show();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public static void main(String[] args) {
- launch(args);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement