Ejemplo n.º 1
0
  /**
   * Instancie un controleur secondaire pour la fenetre de consultation du mot à consulter
   *
   * @return
   */
  private Stage loadConsultation() {
    Stage stageConsultation = null;
    FXMLLoader fxmlLoader = new FXMLLoader(this.getClass().getResource("../dictionnaire_mot.fxml"));

    VBox rootConsultation = null;

    try {
      rootConsultation = (VBox) fxmlLoader.load();
      FXMLController_2 subController = (FXMLController_2) fxmlLoader.getController();

      subController.setController(this);
      subController.setMotAConsulter(model.motSelectionne);
      subController.setImage();
      subController.init();

      Scene sceneConsultation = new Scene(rootConsultation);
      stageConsultation = new Stage();
      stageConsultation.setScene(sceneConsultation);
      stageConsultation.setTitle("Consultation");

      setConsultWindowCloseHandler(stageConsultation, subController);

    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return stageConsultation;
  }
  public InteractionsListController() {
    logger.entry();
    FXMLLoader fxmlLoader =
        new FXMLLoader(getClass().getResource("/fxml/customcontrol/InteractionsList.fxml"));
    fxmlLoader.setController(this);
    fxmlLoader.setRoot(this);
    try {
      fxmlLoader.load();

    } catch (IOException ex) {
      logger.log(Level.FATAL, ex.getMessage(), ex);
    }
    logger.exit();
  }
Ejemplo n.º 3
0
  @Override
  public void start(Stage primaryStage) {
    try {
      TabPane page = (TabPane) FXMLLoader.load(Main.class.getResource("simple.fxml"));
      Scene scene = new Scene(page);
      primaryStage.setScene(scene);
      primaryStage.setTitle("Hotels");
      primaryStage.show();

      textf = (TextField) scene.lookup("#HotelNameTextb");
      Button create = (Button) scene.lookup("#CreateButton");
      create.setOnAction(this::handleButtonAction);

    } catch (Exception ex) {
      Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }
  }