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());
    stage.setWidth(300);/*from w  ww. j  a v a2  s  .c o  m*/
    stage.setHeight(150);

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");

    toolTip.setTextAlignment(TextAlignment.CENTER);

    button.setTooltip(toolTip);

    ((Group) scene.getRoot()).getChildren().add(button);

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

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   w w  w.  j  a v  a 2 s.c om*/

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

From source file:Main.java

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

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

    Rectangle rect = new Rectangle();
    rect.setWidth(100);//from   ww  w  . java  2 s .com
    rect.setHeight(100);
    rect.setTranslateX(135);
    rect.setTranslateY(11.0);

    rectangleGroup.getChildren().add(rect);

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

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Shapes");
    Group root = new Group();
    Scene scene = new Scene(root, 300, 300, Color.WHITE);

    Ellipse bigCircle = new Ellipse(20, 20);
    bigCircle.setCenterX(20);/*from  w w  w .  j  a  va 2  s .c o  m*/
    bigCircle.setCenterY(20);
    bigCircle.setRadiusX(10);
    bigCircle.setRadiusY(10);

    root.getChildren().add(bigCircle);

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

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());
    barChart.setTitle("A");
    primaryStage.setTitle("BarChart example");

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

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);/*w w  w .j  av  a2  s.co m*/
    stage.setHeight(150);

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");

    System.out.println(toolTip.graphicTextGapProperty());

    button.setTooltip(toolTip);
    ((Group) scene.getRoot()).getChildren().add(button);

    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.web("0x0000FF"));

    Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com");
    Font sanSerif = Font.font("Dialog", 30);
    text.setFont(sanSerif);//from  w w  w. ja  va2 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) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);/*from w w w. j a  v a  2s  .c  om*/
    stage.setHeight(150);

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");

    toolTip.setTextOverrun(OverrunStyle.CENTER_ELLIPSIS);

    button.setTooltip(toolTip);

    ((Group) scene.getRoot()).getChildren().add(button);

    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, new Color(0, 0, 1, 1.0));

    Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com");
    Font sanSerif = Font.font("Dialog", 30);
    text.setFont(sanSerif);/*  w  w  w. j av a  2  s  .  co  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) {
    Scene scene = new Scene(new Group(), 450, 250);
    ComboBox<String> myComboBox = new ComboBox<String>();
    myComboBox.getItems().addAll("A", "B", "C", "D", "E");
    myComboBox.setValue("A");
    System.out.println(myComboBox.getValue());

    myComboBox.setValue(null);/*w  w w . j  a  v  a 2  s  . co  m*/

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