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:Main.java

@Override
public void start(Stage stage) {
    ArcTo arcTo = new ArcTo();
    arcTo.setX(20);//  w  w  w. java2  s.c o  m
    arcTo.setY(30);

    arcTo.setRadiusX(30);
    arcTo.setRadiusY(30);

    Path path = new Path(new MoveTo(0, 0), new VLineTo(100), new HLineTo(100), new VLineTo(50), arcTo);
    HBox box = new HBox(path);

    box.setSpacing(10);

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:main.java.de.tw.ecm.toolkit.ECMToolkit.java

@Override
public void start(Stage primaryStage) {
    log.entry();/*  w w w.j a v a  2  s. c om*/
    this.primaryStage = primaryStage;
    try {
        this.context = Context.context();
        this.viewContext = ViewContext.context();
        this.context.put(this);
        this.viewContext.setPrimaryStage(primaryStage);
        this.parseCmd(this.getParameters());
        primaryStage.setTitle("ECM Toolkit");
        this.viewContext.showLoginView();
        primaryStage.show();
    } catch (Exception ex) {
        log.catching(ex);
    }
    log.exit();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    String imagePath = "resources/picture/yourImage.jpg";
    Image image = new Image(imagePath);

    ImageView imageView = new ImageView(image);

    Button saveBtn = new Button("Save Image");
    saveBtn.setOnAction(e -> saveToFile(image));

    VBox root = new VBox(10, imageView, saveBtn);
    Scene scene = new Scene(root);
    stage.setScene(scene);//ww w  .  j a va 2  s  .  c  om
    stage.setTitle("");
    stage.show();
}

From source file:mesclasses.view.TimetableController.java

private Cours openEditDialog(Cours coursToEdit, Cours originalCours) {
    try {//  w ww.  j a  v  a  2  s . c om
        // Load the fxml file and create a new stage for the popup dialog.
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(MainApp.class.getResource(Constants.COURS_EDIT_DIALOG));
        AnchorPane page = (AnchorPane) loader.load();

        // Create the dialog Stage.
        Stage dialogStage = new Stage();
        dialogStage.setTitle("Edition d'un cours");
        dialogStage.initModality(Modality.WINDOW_MODAL);
        dialogStage.initOwner(primaryStage);
        Scene scene = new Scene(page);
        dialogStage.setScene(scene);

        // Set the person into the controller.
        CoursEditDialogController controller = loader.getController();
        controller.setDialogStage(dialogStage);
        controller.setCours(coursToEdit, false);

        // Show the dialog and wait until the user closes it
        dialogStage.showAndWait();
        int status = controller.getStatus();
        if (status >= 0) {
            //update/cancel
            return controller.getCours();
        } else {
            //delete
            getPane(coursToEdit).getChildren().remove(coursToEdit.getEvent());
            int seances = model.delete(originalCours).size();
            ModalUtil.info("Sances modifies", seances + " sances ont t modifies");
            return null;
        }

    } catch (IOException e) {
        notif(e);
        return null;
    }
}

From source file:com.exalttech.trex.ui.UIBaseTest.java

@Override
public void start(Stage stage) throws Exception {
    TrexApp.setPrimaryStage(stage);/*from   w ww.ja  va  2  s. c o  m*/
    AnchorPane page = (AnchorPane) FXMLLoader.load(getClass().getResource("/fxml/MainView.fxml"));
    Scene scene = new Scene(page);
    scene.getStylesheets().add(TrexApp.class.getResource("/styles/mainStyle.css").toExternalForm());
    stage.setScene(scene);
    stage.setTitle("TRex");
    stage.setResizable(true);
    stage.setMinWidth(1100);
    stage.setMinHeight(670);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    createControls();//from w  w w . java  2s . co  m
    createMedia();

    final Scene scene = new Scene(createGridPane(), 800, 400);
    //  final URL stylesheet = getClass().getResource("media.css");
    //  scene.getStylesheets().add(stylesheet.toString());

    primaryStage.setScene(scene);
    primaryStage.setTitle("Audio Player 2");
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Button btn = new Button();
    btn.setText("Say 'Hello World'");
    btn.setOnAction(new EventHandler<ActionEvent>() {

        @Override/*from   w w w. j  ava  2s  . co  m*/
        public void handle(ActionEvent event) {
            System.out.println("Hello World!");
        }
    });

    StackPane root = new StackPane();
    root.getChildren().add(btn);

    Scene scene = new Scene(root, 300, 250);

    primaryStage.setTitle("Hello World!");
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Button b1 = new Button("Close");
    b1.setEffect(new DropShadow());

    Button b2 = new Button("Close");

    Button b3 = new Button("Close");
    b3.setEffect(new DropShadow());
    b3.setRotate(30);//w ww. ja  v  a 2 s.co m

    Button b4 = new Button("Close");

    VBox root = new VBox();
    root.getChildren().addAll(b1, b2, b3, b4);

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Testing LayoutBounds");
    stage.show();

}

From source file:Main.java

@Override
public void start(Stage stage) {
    msgLbl.setPrefWidth(150);/*from  www .  ja  v a  2  s . c  o m*/

    sayHelloBtn.setOnAction(this::sayHello);

    VBox root = new VBox(10);
    root.getChildren().addAll(msgLbl, sayHelloBtn);
    root.setStyle("-fx-padding: 10;" + "-fx-border-style: solid inside;" + "-fx-border-width: 2;"
            + "-fx-border-insets: 5;" + "-fx-border-radius: 5;" + "-fx-border-color: blue;");
    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Hello FXML");
    stage.show();
}

From source file:Main.java

@Override
public void start(final Stage stage) {
    final Keyboard keyboard = new Keyboard(new Key(KeyCode.A), new Key(KeyCode.S), new Key(KeyCode.D),
            new Key(KeyCode.F));

    final Scene scene = new Scene(new Group(keyboard.createNode()));
    stage.setScene(scene);//from www.  ja  v a 2 s  . c o  m
    stage.setTitle("Keyboard Example");
    stage.show();
}