Package javafx.stage

Examples of javafx.stage.Stage


 
  public void fisher() throws IOException {
    FXMLLoader loader = new FXMLLoader(
        JBot.class.getResource("Fisher.fxml"));
    AnchorPane aPane = (AnchorPane) loader.load();
    Stage stage = new Stage();
    stage.initStyle(StageStyle.DECORATED);
    Scene scene = new Scene(aPane);
    stage.setScene(scene);
    stage.show();
  }
View Full Code Here


  public void spellCaster() throws IOException {
    FXMLLoader loader = new FXMLLoader(
        JBot.class.getResource("SpellCaster.fxml"));
    AnchorPane aPane = (AnchorPane) loader.load();
    Stage stage = new Stage();
    stage.initStyle(StageStyle.DECORATED);
    Scene scene = new Scene(aPane);
    stage.setScene(scene);
    stage.show();
  }
View Full Code Here

 
  public void selectRod() throws IOException, AWTException {
    FXMLLoader loader = new FXMLLoader(
        JBot.class.getResource("Select.fxml"));
    AnchorPane selectDialog = (AnchorPane) loader.load();
    final Stage stage = new Stage();
    stage.initStyle(StageStyle.TRANSPARENT);
    Scene scene = new Scene(selectDialog);
    stage.setScene(scene);
    stage.setOpacity(0.1);
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    stage.setWidth(screenSize.getWidth());
    stage.setHeight(screenSize.getHeight());
    stage.show();
    scene.setOnMousePressed(new EventHandler<MouseEvent>() {
      public void handle(MouseEvent me) {
        rodX = (int) me.getScreenX();
        rodY = (int) me.getScreenY();
        stage.close();
      }
    });
  }
View Full Code Here

 
  public void selectWater() throws IOException {
    FXMLLoader loader = new FXMLLoader(
        JBot.class.getResource("Select.fxml"));
    AnchorPane selectDialog = (AnchorPane) loader.load();
    final Stage stage = new Stage();
    stage.initStyle(StageStyle.TRANSPARENT);
    Scene scene = new Scene(selectDialog);
    stage.setScene(scene);
    stage.setOpacity(0.1);
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    stage.setWidth(screenSize.getWidth());
    stage.setHeight(screenSize.getHeight());
    stage.show();
    scene.setOnMousePressed(new EventHandler<MouseEvent>() {
      public void handle(MouseEvent me) {
        fishX0 = (int) me.getScreenX();
        fishY0 = (int) me.getScreenY();
      }
    })
    scene.setOnMouseReleased(new EventHandler<MouseEvent>() {
      public void handle(MouseEvent me) {
        fishX1 = (int) me.getScreenX();
        fishY1 = (int) me.getScreenY();
        fishDelay = Integer.parseInt(delay.getText());
        timez = Integer.parseInt(times.getText());
        prop.setProperty("fishX0", Integer.toString(fishX0));
        prop.setProperty("fishY0", Integer.toString(fishY0));
        prop.setProperty("rodX", Integer.toString(rodX));
        prop.setProperty("rodY", Integer.toString(rodY));
        if (delay.getText() != null || delay.getText().equalsIgnoreCase("")); {
        prop.setProperty("fishDelay", delay.getText());
        }
        if (times.getText() != null || times.getText().equalsIgnoreCase("")) {
          prop.setProperty("times", times.getText());
        }
        prop.setProperty("fishX1", Integer.toString(fishX1));
        prop.setProperty("fishY1", Integer.toString(fishY1));
        try {
          prop.store(new FileOutputStream("config.properties"), null);
          stage.close();
        } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
View Full Code Here

  public void warning(String message) {
    updateMessage(message, Color.RED, false);
  }

  public void error(String message) {
    Stage dialog = new Stage();
    dialog.initStyle(StageStyle.UTILITY);
    Scene scene = new Scene(new Group(new Text(25, 25, message)));
    dialog.setScene(scene);
    dialog.show();
  }
View Full Code Here

   
    public void showAboutUsDialog(){
        try{
            FXMLLoader loader = new FXMLLoader(MainQuizCreator.class.getResource("view/AboutUsDialog.fxml"));
            AnchorPane page = (AnchorPane) loader.load();
            Stage dialogStage = new Stage();
            dialogStage.setTitle("About Us");
            dialogStage.initModality(Modality.WINDOW_MODAL);
            dialogStage.initOwner(primaryStage);
            Scene scene = new Scene(page);
            dialogStage.setScene(scene);
           
            AboutUsDialogController controller = loader.getController();
            controller.setDialogStage(dialogStage);
           
            dialogStage.showAndWait();
           
   
        }catch (IOException e){
            e.printStackTrace();
        }
View Full Code Here

    public static void runAlert(BiConsumer<Stage, AlertWindowController> setup) {
        try {
            // JavaFX doesn't actually have a standard alert template. Instead the Scene Builder app will create FXML
            // files for an alert window for you, and then you customise it as you see fit.
            Stage dialogStage = new Stage();
            dialogStage.initModality(Modality.APPLICATION_MODAL);
            FXMLLoader loader = new FXMLLoader(GuiUtils.class.getResource("alert.fxml"));
            Pane pane = loader.load();
            AlertWindowController controller = loader.getController();
            setup.accept(dialogStage, controller);
            dialogStage.setScene(new Scene(pane));
            dialogStage.showAndWait();
        } catch (Throwable e) {
            // We crashed whilst trying to show the alert dialog. This can happen if we're being crashed by inbound
            // closures onto the event thread which will execute in the nested event loop. Just give up here: at the
            // moment we have no way to filter them out of the event queue.
            e.printStackTrace();
View Full Code Here

public class Shell extends Decorations {
  private Stage stage;

  public Shell(Display d) {
    super(d, SWT.DIALOG_TRIM);
    stage = new Stage();
    stage.setScene(new Scene(internal_getNativeObject()));
  }
View Full Code Here

    stage.setScene(new Scene(internal_getNativeObject()));
  }

  public Shell(Display d, int style) {
    super(d, style);
    stage = new Stage();
    stage.setScene(new Scene(internal_getNativeObject()));
  }
View Full Code Here

        mouseDragOffsetY = event.getSceneY();
      }
    });
    decorationArea.setOnMouseDragged(new EventHandler<MouseEvent>() {
      public void handle(MouseEvent event) {
        Stage w = getStage();
        w.setX(event.getScreenX() - mouseDragOffsetX);
        w.setY(event.getScreenY() - mouseDragOffsetY);
      }
    });
  }
View Full Code Here

TOP

Related Classes of javafx.stage.Stage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.