Example usage for javafx.stage Stage hide

List of usage examples for javafx.stage Stage hide

Introduction

In this page you can find the example usage for javafx.stage Stage hide.

Prototype

public void hide() 

Source Link

Document

Attempts to hide this Window by setting the visibility to false.

Usage

From source file:memoryaid.GalleryController.java

@FXML
private void HandleGalleryLinkAction(ActionEvent event) throws IOException {
    System.out.println("You clicked me!");
    Parent Gallery = FXMLLoader.load(getClass().getResource("FamilySpecHome.fxml"));
    Scene Gallery_scene = new Scene(Gallery);
    Stage app_stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
    app_stage.hide();
    app_stage.setScene(Gallery_scene);/*  w ww.  jav  a  2 s.  c  om*/
    app_stage.show();
}

From source file:memoryaid.GalleryController.java

@FXML
private void uploadImageAction(ActionEvent event) throws IOException {
    String imgPath = imagePathText.getText();
    String baseName = FilenameUtils.getBaseName(imgPath);

    String destinationPath = "/Users/madhaviunnam/NetBeansProjects/MemoryAid/src/GalleryImages";
    File destinationPathObject = new File(destinationPath + "/" + baseName + ".png");
    File sourceFilePathObject = new File(imgPath);
    FileUtils.copyFile(sourceFilePathObject, destinationPathObject);
    Parent Gallery = FXMLLoader.load(getClass().getResource("Gallery1.fxml"));
    Scene Gallery_scene = new Scene(Gallery);
    Stage app_stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
    app_stage.hide();
    app_stage.setScene(Gallery_scene);/*w  ww  .  ja  va2 s  .  c  o  m*/
    app_stage.show();
}

From source file:MasterRoomControllerFx.rooms.charts.RoomChartController.java

@FXML
private void closeStageEvent(MouseEvent event) {
    Stage stage = (Stage) backIcon.getScene().getWindow();
    stage.hide();
}

From source file:de.micromata.mgc.javafx.ControllerService.java

public <M, C extends AbstractModelController<M>> C loadAsWindow(AbstractMainWindow<?> mainWindow,
        Class<C> controllerClass, M model, String dialogTitle) {
    Pair<Pane, C> pair = loadControlWithModel(controllerClass, Pane.class, model, mainWindow);
    Stage stage = new Stage();
    stage.addEventHandler(WindowEvent.WINDOW_CLOSE_REQUEST, e -> {
        stage.hide();
        e.consume();/*w  ww .  ja v  a2  s.com*/
    });
    Pane root = pair.getFirst();
    C controller = pair.getSecond();
    Scene s = new Scene(root);//, AbstractConfigDialog.PREF_WIDTH, AbstractConfigDialog.PREF_HEIGHT
    controller.setParent(root);
    controller.setScene(s);
    controller.setStage(stage);
    stage.setScene(s);
    //stage.setResizable(false);
    stage.setTitle(dialogTitle);
    return controller;
}

From source file:de.micromata.mgc.javafx.ControllerService.java

public <M, C extends AbstractModelController<M>> C loadAsDialog(AbstractMainWindow<?> mainWindow,
        Class<C> controllerClass, String dialogTitle) {
    Pair<Pane, C> pair = loadControllerControl(controllerClass, Pane.class, mainWindow);
    Stage stage = new Stage();
    stage.addEventHandler(WindowEvent.WINDOW_CLOSE_REQUEST, e -> {
        stage.hide();
        e.consume();//from   w  w w . jav  a2s. c om
    });
    Pane root = pair.getFirst();
    C controller = pair.getSecond();
    Scene s = new Scene(root);//, AbstractConfigDialog.PREF_WIDTH, AbstractConfigDialog.PREF_HEIGHT
    controller.setParent(root);
    controller.setScene(s);
    controller.setStage(stage);
    stage.setScene(s);
    stage.initModality(Modality.APPLICATION_MODAL);
    //stage.setResizable(false);
    stage.setTitle(dialogTitle);
    return controller;
}

From source file:application.Main.java

private void hide(final Stage stage) {
    Platform.runLater(new Runnable() {
        @Override//from  w ww .  j  av  a 2 s . c o m
        public void run() {
            // if the operating system
            // supports the system tray
            if (SystemTray.isSupported()) {
                stage.hide();
                showProgramIsMinimizedMsg();
            } else {
                System.exit(0);
            }
        }
    });
}

From source file:com.exalttech.trex.ui.controllers.PacketBuilderHomeController.java

/**
 * Handle Enter key pressed
 *
 * @param stage
 */
@Override
public void onEnterKeyPressed(Stage stage) {
    stage.hide();
}

From source file:com.exalttech.trex.ui.controllers.PacketBuilderHomeController.java

/**
 * Close button click handler//  w  w  w  .  j  a v  a2s  .  co  m
 *
 * @param event
 */
@FXML
public void handleCloseDialog(final MouseEvent event) {
    Node node = (Node) event.getSource();
    Stage stage = (Stage) node.getScene().getWindow();
    stage.hide();
}

From source file:com.exalttech.trex.ui.controllers.PacketBuilderHomeController.java

/**
 * Save button click handler/*from w  w w. j  av  a 2 s. com*/
 *
 * @param event
 */
@FXML
public void saveProfileBtnClicked(ActionEvent event) {
    if (saveStream()) {
        // close the dialog
        Node node = (Node) event.getSource();
        Stage stage = (Stage) node.getScene().getWindow();
        stage.hide();
    }
}

From source file:memoryaid.SetReminderController.java

@FXML
private void handleBackButtonAction(ActionEvent event) throws IOException {
    System.out.println("You clicked back/cancel!");
    Parent setReminder = FXMLLoader.load(getClass().getResource("Caregiver.fxml"));
    Scene set_reminder_back_scene = new Scene(setReminder);
    Stage app_stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
    app_stage.hide();
    app_stage.setScene(set_reminder_back_scene);
    app_stage.show();/*from   www.  j  a  va2  s  .co m*/
}