Example usage for javafx.stage Stage setTitle

List of usage examples for javafx.stage Stage setTitle

Introduction

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

Prototype

public final void setTitle(String value) 

Source Link

Usage

From source file:com.coolchick.translatortemplater.Main.java

@Override
public void start(final Stage primaryStage) throws Exception {
    this.primaryStage = primaryStage;
    primaryStage.setTitle("Hello Cel");
    showMailSpitter();// www  .j a  v  a2 s. c  o  m
    primaryStage.show();
}

From source file:account.management.controller.ViewSalaryVoucherController.java

/**
 * Initializes the controller class.//from   w  w  w  . ja v  a2 s  . co  m
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    this.voucher_no.setCellValueFactory(new PropertyValueFactory("id"));
    this.date.setCellValueFactory(new PropertyValueFactory("date"));
    this.section.setCellValueFactory(new PropertyValueFactory("section"));
    this.name.setCellValueFactory(new PropertyValueFactory("name"));
    this.basis.setCellValueFactory(new PropertyValueFactory("basis"));
    this.amount.setCellValueFactory(new PropertyValueFactory("total"));

    final ContextMenu contextMenu = new ContextMenu();
    MenuItem item1 = new MenuItem("    View                  ");
    item1.setOnAction(new EventHandler<ActionEvent>() {
        public void handle(ActionEvent e) {
            Data.salaryVoucher = table.getSelectionModel().getSelectedItem();

            try {
                Parent root = FXMLLoader
                        .load(getClass().getResource(MetaData.viewPath + "EditSalaryVoucher.fxml"));
                Scene scene = new Scene(root);
                Stage stage = new Stage();
                scene.setRoot(root);
                stage.setResizable(false);
                stage.setTitle("Salary Voucher");
                stage.setScene(scene);
                stage.showAndWait();
                int index = table.getSelectionModel().getSelectedIndex();
                getData();

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

        }
    });
    contextMenu.getItems().addAll(item1);
    this.table.setContextMenu(contextMenu);

}

From source file:com.kotcrab.vis.editor.CrashReporter.java

@Override
public void start(Stage stage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("crash-reporter-layout.fxml"));

    Scene scene = new Scene(root);

    stage.setTitle("VisEditor Crash Reporter");
    stage.getIcons().add(new Image(CrashReporter.class.getResourceAsStream("icon.png")));
    stage.setScene(scene);/*w  w w  .  jav a 2 s  . com*/
    stage.setResizable(false);
    stage.sizeToScene();
    stage.show();
}

From source file:net.sf.anathema.framework.presenter.action.about.AnathemaAboutAction.java

private Stage initializeDialogStage(Scene scene) {
    final Stage aboutStage = new Stage();
    aboutStage.initStyle(StageStyle.UNDECORATED);
    aboutStage.initOwner(stage);/*from   w  ww .j  a  v a 2  s.c o m*/
    aboutStage.setResizable(false);
    aboutStage.setTitle(resources.getString("Help.AboutDialog.Title"));
    aboutStage.setScene(scene);
    initCloseOnEscape(aboutStage);
    return aboutStage;
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Button okBtn = new Button("OK");
    Button cancelBtn = new Button("Cancel");

    cancelBtn.setPrefWidth(100);/*www.  j  av a2  s.c om*/

    VBox root = new VBox();
    root.getChildren().addAll(okBtn, cancelBtn);

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Overriding Node Sizes");
    stage.show();

    System.out.println("okBtn.getPrefWidth(): " + okBtn.getPrefWidth());
    System.out.println("okBtn.getMinWidth(): " + okBtn.getMinWidth());
    System.out.println("okBtn.getMaxWidth(): " + okBtn.getMaxWidth());

    System.out.println("cancelBtn.getPrefWidth(): " + cancelBtn.getPrefWidth());
    System.out.println("cancelBtn.getMinWidth(): " + cancelBtn.getMinWidth());
    System.out.println("cancelBtn.getMaxWidth(): " + cancelBtn.getMaxWidth());
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Group group = new Group();
    Scene scene = new Scene(group);

    StackPane stack = new StackPane();
    stack.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE);
    stack.getChildren().addAll(new Rectangle(100, 100, Color.BLUE));

    group.getChildren().add(stack);/*from  ww  w  .  j a  va 2 s .  co  m*/

    stage.setTitle("Welcome to JavaFX!");
    stage.setScene(scene);
    stage.sizeToScene();
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {

    Button openURLButton = new Button("Go!");
    openURLButton.setOnAction(e -> {/*ww  w . ja va  2 s .  c o m*/
        HostServices host = getHostServices();
        JSObject js = host.getWebContext();
        if (js == null) {
            Stage s = new Stage(StageStyle.UTILITY);
            s.initModality(Modality.WINDOW_MODAL);
            Label msgLabel = new Label("This is an FX alert!");
            Group root = new Group(msgLabel);
            Scene scene = new Scene(root);
            s.setScene(scene);
            s.setTitle("FX Alert");
            s.show();
        } else {
            js.eval("window.alert('This is a JavaScript alert!')");
        }
    });

    Scene scene = new Scene(openURLButton);
    stage.setScene(scene);
    stage.setTitle("Knowing the Host");
    stage.show();
}

From source file:ninja.javafx.smartcsv.fx.SmartCSV.java

private void showUI(Stage primaryStage, String name, String version) {
    SmartCSVController smartCVSController = appContext.getBean(SmartCSVController.class);
    Scene scene = new Scene((Parent) smartCVSController.getView());

    primaryStage.setScene(scene);//from  w  w w. ja  v a 2 s. com
    primaryStage.setTitle(String.format("%s %s", name, version));
    primaryStage.show();
    primaryStage.setMaximized(true);

    primaryStage.setOnCloseRequest(event -> {
        if (!smartCVSController.canExit()) {
            event.consume();
        } else {
            exit();
        }
    });
}

From source file:com.cdd.bao.editor.endpoint.BrowseEndpoint.java

public BrowseEndpoint(Stage stage) {
    this.stage = stage;

    stage.setTitle("BioAssay Schema Browser");

    treeRoot = new TreeItem<>(new Branch(this));
    treeView = new TreeView<>(treeRoot);
    treeView.setEditable(true);//from   www  .j  a v  a  2  s. co  m
    treeView.setCellFactory(p -> new BrowseTreeCell());
    treeView.getSelectionModel().selectedItemProperty().addListener((observable, oldval, newval) -> {
        changeValue(newval.getValue());
    });

    display = new DisplaySchema();

    StackPane sp1 = new StackPane(), sp2 = new StackPane();
    sp1.getChildren().add(treeView);
    sp2.getChildren().add(display);

    splitter = new SplitPane();
    splitter.setOrientation(Orientation.HORIZONTAL);
    splitter.getItems().addAll(sp1, sp2);
    splitter.setDividerPositions(0.4, 1.0);

    root = new BorderPane();
    root.setTop(menuBar);
    root.setCenter(splitter);

    Scene scene = new Scene(root, 700, 600, Color.WHITE);

    stage.setScene(scene);

    treeView.setShowRoot(false);

    rebuildTree();

    Platform.runLater(() -> treeView.getFocusModel().focus(treeView.getSelectionModel().getSelectedIndex())); // for some reason it defaults to not the first item

    new Thread(() -> backgroundLoadTemplates()).start();
}

From source file:cz.lbenda.rcp.DialogHelper.java

public void openWindowInCenterOfStage(Stage parentStage, Pane pane, String title) {
    Stage stage = new Stage();
    stage.setTitle(title);
    stage.setScene(new Scene(pane, pane.getPrefWidth(), pane.getPrefHeight()));
    stage.getIcons().addAll(parentStage.getIcons());
    stage.show();/* w ww. ja  v a 2 s  .c o  m*/
    stage.setX(parentStage.getX() + (parentStage.getWidth() - stage.getWidth()) / 2);
    stage.setY(parentStage.getY() + (parentStage.getHeight() - stage.getHeight()) / 2);
}