Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. package Contrôleur;
  2.  
  3.  
  4. import java.io.IOException;
  5.  
  6. import javafx.application.Application;
  7. import javafx.fxml.FXMLLoader;
  8. import javafx.scene.Scene;
  9. import javafx.scene.layout.AnchorPane;
  10. import javafx.scene.layout.BorderPane;
  11. import javafx.stage.Stage;
  12. import javafx.stage.Stage;
  13.  
  14. public class Main extends Application {
  15.    
  16.     private static Stage primaryStage;
  17.    // private BorderPane rootLayout;
  18.  
  19.     @Override
  20.     public void start(Stage primaryStage) {
  21.        
  22.          Main.primaryStage = primaryStage;
  23.             Main.primaryStage.setTitle("Menu DVDIUT");
  24.  
  25.              /**
  26.              * Affichage du menu principal
  27.              */
  28.              try {
  29.                 // Chargement du menu
  30.                     // Load root layout from fxml file.
  31.                     FXMLLoader loader = new FXMLLoader();
  32.                     loader.setLocation(Main.class.getResource("view/Menu.fxml"));
  33.                     AnchorPane startMenu = (AnchorPane) loader.load();
  34.                    
  35.          
  36.                     // Show the scene containing the root layout.
  37.                     Scene scene = new Scene(startMenu);
  38.                     primaryStage.setScene(scene);
  39.                     primaryStage.setScene(scene);
  40.                     primaryStage.show();
  41.                    
  42.                 } catch (IOException e) {
  43.                     e.printStackTrace();
  44.                 }
  45.            
  46.     }
  47.    
  48.    
  49.         public Stage getPrimaryStage() {
  50.             return primaryStage;
  51.         }
  52.        
  53.  
  54.  
  55.    
  56.     public static void main(String[] args) {
  57.        
  58.         launch(args);
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement