Example usage for javafx.stage Stage show

List of usage examples for javafx.stage Stage show

Introduction

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

Prototype

@Override
public final void show() 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 260, 80);
    stage.setScene(scene);//from www.  j  a  va  2  s .  c  o m

    Group g = new Group();

    ProgressIndicator p1 = new ProgressIndicator();

    g.getChildren().add(p1);

    scene.setRoot(g);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");

    Group g = new Group();
    Scene scene = new Scene(g, 550, 250);

    AudioClip plonkSound = new AudioClip("http://somehost/p.aiff");
    plonkSound.play();//from  w  w w.j  a  v a 2  s.co  m

    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group group = new Group();

    Button button = new Button("Button");

    button.setStyle("-fx-font-size: 14px;");

    group.getChildren().add(button);/*from   w  w  w.j  a v  a 2  s  .  co  m*/

    Scene scene = new Scene(group, 300, 200);
    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());

    VBox root = new VBox();
    root.getChildren().addAll(b1);/*from w ww  .j a  v a 2 s.com*/

    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) {
    Group root = new Group();
    Scene scene = new Scene(root, 300, 150);
    stage.setScene(scene);//from ww w  .j a  v a  2s .  com
    stage.setTitle("Sample");

    Text t = new Text(10, 50, "This is a test");
    t.setFont(new Font(20));

    root.getChildren().add(t);

    stage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group group = new Group();

    Button button = new Button("Button");

    button.setStyle("-fx-padding: 10 20 10 20;");

    group.getChildren().add(button);//from   w  w w.  j a  va  2  s. com

    Scene scene = new Scene(group, 300, 200);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {

    Path path = new Path();
    path.getElements().add(new MoveTo(0.0f, 0.0f));
    path.getElements().add(new HLineTo(80.0f));

    Group root = new Group();
    root.getChildren().add(path);//from w  w w  .ja va  2s  .  c  o  m
    primaryStage.setScene(new Scene(root, 300, 250));
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(final Stage stage) throws Exception {
    FXMLLoader f = new FXMLLoader();
    final Parent fxmlRoot = (Parent) f.load(new FileInputStream(new File("JavaFx2Menus.fxml")));
    stage.setScene(new Scene(fxmlRoot));
    stage.show();
}

From source file:Main.java

private void createClipList(GridPane grid) {
    final VBox vbox = new VBox(30);
    vbox.setAlignment(Pos.TOP_CENTER);//from w  w  w.jav  a 2s.c  o m

    final Label clipLabel = new Label("Code Monkey To-Do List:");
    clipLabel.setId("clipLabel");

    final Button getUpButton = new Button("Get Up, Get Coffee");
    getUpButton.setPrefWidth(300);
    getUpButton.setOnAction(createPlayHandler(coffeeClip));

    final Button goToJobButton = new Button("Go to Job");
    goToJobButton.setPrefWidth(300);
    goToJobButton.setOnAction(createPlayHandler(jobClip));

    final Button meetingButton = new Button("Have Boring Meeting");
    meetingButton.setPrefWidth(300);
    meetingButton.setOnAction(createPlayHandler(meetingClip));

    final Hyperlink link = new Hyperlink("About Code Monkey...");
    link.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            WebView wv = new WebView();
            wv.getEngine().load("http://www.jonathancoulton.com/2006/04/14/" + "thing-a-week-29-code-monkey/");

            Scene scene = new Scene(wv, 720, 480);

            Stage stage = new Stage();
            stage.setTitle("Code Monkey");
            stage.setScene(scene);
            stage.show();
        }
    });

    vbox.getChildren().addAll(clipLabel, getUpButton, goToJobButton, meetingButton, link);

    GridPane.setHalignment(vbox, HPos.CENTER);
    GridPane.setHgrow(vbox, Priority.ALWAYS);
    GridPane.setVgrow(vbox, Priority.ALWAYS);
    grid.add(vbox, 0, 0, GridPane.REMAINING, 1);
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox choiceBoxRef = ChoiceBoxBuilder.create().items(cursors).build();

    VBox box = new VBox();
    box.getChildren().add(choiceBoxRef);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);/*w w  w  .  ja va2s.com*/
    stage.setScene(scene);
    stage.show();
    scene.cursorProperty().bind(choiceBoxRef.getSelectionModel().selectedItemProperty());

}