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 primaryStage) {
    CategoryAxis xAxis = new CategoryAxis();
    NumberAxis yAxis = new NumberAxis();
    BarChart barChart = new BarChart(xAxis, yAxis, getChartData(), 0.2);
    barChart.setTitle("A");
    primaryStage.setTitle("BarChart example");

    StackPane root = new StackPane();
    root.getChildren().add(barChart);/*ww  w  . j  a v  a  2s  . co m*/
    primaryStage.setScene(new Scene(root, 400, 250));
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250);
    Button btn = new Button();
    btn.setText("Hello World");
    btn.setOnAction(new EventHandler<ActionEvent>() {
        public void handle(ActionEvent event) {
            System.out.println("Hello World");
        }/*from w  ww.  ja v  a 2 s  .c o  m*/
    });
    root.getChildren().add(btn);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");
    Group root = new Group();
    Scene scene = new Scene(root, 550, 250, Color.web("0x0000FF", 1.0));

    Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com");
    Font sanSerif = Font.font("Dialog", 30);
    text.setFont(sanSerif);//  w ww .jav a2  s  . c o m
    text.setFill(Color.RED);
    root.getChildren().add(text);

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

From source file:Main.java

@Override
 public void start(Stage stage) {
     String name = Thread.currentThread().getName();
     System.out.println("start() method: " + name);

     // Add an Exit button to the scene
     Button exitBtn = new Button("Exit");
     exitBtn.setOnAction(e -> Platform.exit());

     Scene scene = new Scene(new Group(exitBtn), 300, 100);
     stage.setScene(scene);// ww  w  .  j av  a 2s.  c o  m
     stage.setTitle("JavaFX Application Life Cycle");
     stage.show();
 }

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Label Sample");
    stage.setWidth(400);//from   w  w w .j a  va 2  s .  c o  m
    stage.setHeight(180);

    HBox hbox = new HBox();

    Label label1 = new Label("Search");
    label1.setRotate(270);

    hbox.setSpacing(10);
    hbox.getChildren().add((label1));
    ((Group) scene.getRoot()).getChildren().add(hbox);

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

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    BorderPane root = new BorderPane();
    Scene scene = new Scene(root, 380, 150, Color.WHITE);

    GridPane gridpane = createGridPane();
    FlowPane topBanner = createTopBanner();

    root.setTop(topBanner);//from   w ww. j  av  a 2  s .  c o  m
    root.setCenter(gridpane);

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

From source file:Main.java

@Override
public void start(final Stage stage) throws Exception {
    Group rootGroup = new Group();
    Scene scene = new Scene(rootGroup, 800, 400);

    Text text1 = new Text(25, 25, "java2s.com");
    text1.setFill(Color.CHOCOLATE);
    text1.setFont(Font.font(java.awt.Font.MONOSPACED, 35));

    Effect glow = new Glow(1.0);
    text1.setEffect(glow);/*from www. jav  a2 s.  co  m*/

    rootGroup.getChildren().add(text1);

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

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");
    Group root = new Group();
    Scene scene = new Scene(root, 550, 250, Color.hsb(270, 1.0, 1.0, 1.0));

    Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com");
    Font sanSerif = Font.font("Dialog", 30);
    text.setFont(sanSerif);//from ww w.ja v  a 2  s.  com
    text.setFill(Color.RED);
    root.getChildren().add(text);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Label Sample");
    stage.setWidth(400);/*w  w  w  . j  ava  2s.co  m*/
    stage.setHeight(180);

    HBox hbox = new HBox();

    Label label1 = new Label("Search");
    label1.setTranslateY(50);

    hbox.setSpacing(10);
    hbox.getChildren().add((label1));
    ((Group) scene.getRoot()).getChildren().add(hbox);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    ArcTo arcTo = new ArcTo();
    arcTo.setX(20);/*  w w  w.j  a  v  a2 s.c om*/
    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();
}