Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. package application;
  2. import javafx.application.Application;
  3. import javafx.fxml.FXMLLoader;
  4. import javafx.stage.Stage;
  5. import javafx.scene.Scene;
  6. import javafx.scene.layout.AnchorPane;
  7.  
  8. public class Main extends Application {
  9. private Stage primaryStage;
  10. @Override
  11. public void start(Stage primaryStage) {
  12. this.primaryStage = primaryStage;
  13. mainWindow();
  14. }
  15. public void mainWindow() {
  16. try {
  17. FXMLLoader loader = new FXMLLoader(Main.class.getResource("MainWindowsController.fxml"));
  18. AnchorPane pane = loader.load();
  19. MainWindowsController mainWindowController = loader.getController();
  20. mainWindowController.setMain(this);
  21. Scene scene = new Scene(pane);
  22. primaryStage.setScene(scene);
  23. primaryStage.show();
  24.  
  25. } catch (Exception e) {
  26. e.printStackTrace();
  27. }
  28. }
  29. public static void main(String[] args) {
  30. launch(args);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement