Пример #1
0
  /**
   * This method is called when the splash screen has finished initializing the application. The
   * initialized resources are in a ServiceLocator singleton. Our task is to now create the
   * application MVC components, to hide the splash screen, and to display the application GUI.
   *
   * <p>Multitasking note: This method is called from an event-handler in the Splash_Controller,
   * which means that it is on the JavaFX Application Thread, which means that it is allowed to work
   * with GUI components. http://docs.oracle.com/javafx/2/threads/jfxpub-threads.htm
   */
  public void startApp() {
    // Stage appStage = new Stage();
    serverStage = new Stage();
    // Resources are now initialized
    ServiceLocator sl = ServiceLocator.getServiceLocator();
    Translator t = sl.getTranslator();
    System.out.println("BLABLA");
    try {
      final URL fxmlURL =
          getClass().getResource("/Server/Server.fxml"); // FXML-File from the ClientLogin-Window
      final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL);
      fxmlLoader.setController(new Server_Controller());
      final Parent root = fxmlLoader.load();
      Scene scene = new Scene(root, 650, 450);
      //			scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
      serverStage.setScene(scene);
      serverStage.setTitle(t.getString("program.name.windowName"));
      serverStage.show();
      String zwischenstatus = fxmlURL.toString();
      System.out.println("Application FXML Loader Pfad ist: " + zwischenstatus);
    } catch (Exception e) {
      e.printStackTrace();
    }

    // Close the splash screen, and set the reference to null, so that all
    // Splash_XXX objects can be garbage collected
    splashView.stop();
    splashView = null;

    //        view.start();
  }