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 w  w .  j a  v  a2s  . co m
    stage.setHeight(150);

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

    toolTip.setWrapText(true);

    button.setTooltip(toolTip);

    Tooltip.uninstall(button, toolTip);

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

    stage.setScene(scene);
    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   ww w .  j  a v a2s  .  c o m*/
    stage.setHeight(180);

    HBox hbox = new HBox();

    Label label1 = new Label("Search");
    label1.setFont(new Font("Arial", 30));

    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) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Label Sample");
    stage.setWidth(400);//w w  w  .jav  a  2s.co m
    stage.setHeight(180);

    HBox hbox = new HBox();

    Label label1 = new Label("Search");
    label1.setTextFill(Color.web("#0076a3"));

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

    QuadCurve quad = new QuadCurve();
    quad.setStartX(0.0f);
    quad.setStartY(50.0f);
    quad.setEndX(50.0f);
    quad.setEndY(50.0f);
    quad.setControlX(25.0f);
    quad.setControlY(0.0f);

    root.getChildren().add(quad);

    scene.setRoot(root);
    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);//  ww  w  .  j  a v  a2s .  com
    rect.setHeight(100);

    Shear sh = new Shear();
    sh.setY(0.4);
    rect.getTransforms().add(sh);

    rectangleGroup.getChildren().add(rect);

    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 .  ja va2 s .c om*/
    stage.setHeight(150);

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");
    toolTip.setWrapText(true);
    System.out.println(toolTip.textOverrunProperty());

    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) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);/*from  w  w  w  .  j a v  a2s  . c om*/
    stage.setHeight(150);

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");
    toolTip.setWrapText(true);
    System.out.println(toolTip.wrapTextProperty());

    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) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);/*w ww.j av  a  2 s.  co  m*/
    stage.setHeight(150);

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");
    toolTip.setWrapText(true);
    System.out.println(toolTip.textAlignmentProperty());

    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);

    Label title = new Label("Label 1");
    StackPane stackpane = new StackPane();
    StackPane.setAlignment(title, Pos.BOTTOM_CENTER);
    stackpane.getChildren().addAll(new Label("Label"), title);

    group.getChildren().add(stackpane);//from  w w w . ja v a2  s .c  o  m

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

From source file:Main.java

@Override
public void start(Stage stage) {
    final Group group = new Group();
    Scene scene = new Scene(group, 300, 150);
    stage.setScene(scene);// www. j  av a2 s . c  o m
    stage.setTitle("Sample");

    Stop[] stops = { new Stop(0, Color.WHITE), new Stop(1, Color.BLACK) };
    LinearGradient lg = new LinearGradient(0, 0, 1, 0, true, CycleMethod.NO_CYCLE, stops);
    Rectangle r = new Rectangle(20, 20, 200, 200);
    r.setFill(lg);

    group.getChildren().add(r);
    stage.show();
}