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) {
    Scene scene = new Scene(new Group(), 450, 250);

    TextField notification = new TextField();
    notification.setText("Label");

    notification.clear();/* ww w .j a  v a2  s . c om*/

    GridPane grid = new GridPane();
    grid.setVgap(4);
    grid.setHgap(10);
    grid.setPadding(new Insets(5, 5, 5, 5));
    grid.add(new Label("To: "), 0, 0);
    grid.add(notification, 1, 0);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(grid);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);/* w  ww.  j  a  v a 2s.c  o  m*/
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo(50.0f);
    vlt.setY(.7);
    path.getElements().add(vlt);

    System.out.println(vlt.getY());

    root.getChildren().addAll(path);
    scene.setRoot(root);

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);//from  ww w. ja  v a 2 s .co  m
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo();
    vlt.setY(.7);
    path.getElements().add(vlt);

    System.out.println(vlt.yProperty());

    root.getChildren().addAll(path);
    scene.setRoot(root);

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

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group root = new Group();
    Scene scene = new Scene(root, 551, 400, Color.BLACK);
    Group buttonGroup = new Group();
    Arc rightButton = ArcBuilder.create().type(ArcType.ROUND).radiusX(15).radiusY(15).startAngle(180 - 30)
            .length(60).translateX(40).build();
    buttonGroup.getChildren().add(rightButton);
    buttonGroup.translateYProperty().bind(scene.heightProperty().subtract(10));
    root.getChildren().add(buttonGroup);

    primaryStage.setScene(scene);//from w w  w.j a v a 2  s.co m
    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 a  v a  2 s  .  c  o  m
    stage.setHeight(180);

    HBox hbox = new HBox();
    Image image = new Image(getClass().getResourceAsStream("labels.jpg"));
    Label label1 = new Label("Search", new ImageView(image));

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

    label1.setLabelFor(hbox);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    stage.setTitle("ComboBoxSample");
    Scene scene = new Scene(new Group(), 450, 250);

    CubicCurve cubic = new CubicCurve();
    cubic.setStartX(0.0f);//from   www. j a  va 2s.c o  m
    cubic.setStartY(50.0f);
    cubic.setControlX1(25.0f);
    cubic.setControlY1(0.0f);
    cubic.setControlX2(75.0f);
    cubic.setControlY2(100.0f);
    cubic.setEndX(100.0f);
    cubic.setEndY(50.0f);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(cubic);
    stage.setScene(scene);
    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, Color.web("0x0000FF", 1.0));

    TitledPane t1 = new TitledPane("T1", new Button("B1"));
    TitledPane t2 = new TitledPane("T2", new Button("B2"));
    TitledPane t3 = new TitledPane("T3", new Button("B3"));
    Accordion accordion = new Accordion();
    accordion.getPanes().addAll(t1, t2, t3);

    g.getChildren().add(accordion);//from   w w w .ja  v a 2s . co m

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);/*from w w w .j  a va 2s .  c om*/
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo(50.0f);
    vlt.setY(.7);
    path.getElements().add(vlt);

    System.out.println(vlt.yProperty());

    root.getChildren().addAll(path);
    scene.setRoot(root);

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

From source file:Main.java

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

    final Circle circ = new Circle(40, 40, 30);
    final Group root = new Group(circ);

    final Scene scene = new Scene(root, 800, 400, Color.BEIGE);

    final Text text1 = new Text(25, 25, "java2s.com");
    text1.setFill(Color.DARKBLUE);
    text1.setFont(Font.font(java.awt.Font.SERIF, 25));
    final Effect glow = new Glow(1.0);
    text1.setEffect(glow);//from  ww w . jav  a 2s  .c  o  m
    root.getChildren().add(text1);

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

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Drawing Lines");

    Group root = new Group();
    Scene scene = new Scene(root, 300, 150, Color.GRAY);

    Line redLine = new Line(10, 10, 200, 10);

    redLine.setStroke(Color.RED);
    redLine.setStrokeWidth(10);//w  w w . j av  a  2s  .  c om
    redLine.setStrokeLineCap(StrokeLineCap.BUTT);

    redLine.getStrokeDashArray().addAll(15d, 5d, 15d, 15d, 20d);
    redLine.setStrokeDashOffset(10);

    root.getChildren().add(redLine);

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