Example usage for javafx.stage Stage setScene

List of usage examples for javafx.stage Stage setScene

Introduction

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

Prototype

@Override
final public void setScene(Scene value) 

Source Link

Document

Specify the scene to be used on this stage.

Usage

From source file:com.ti.msp430.usb.hiddemo.JavaUSBFXMain.java

@Override
public void start(Stage primaryStage) throws Exception {

    Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));

    // StackPane root = new StackPane();
    // root.getChildren().add(btn);

    Scene scene = new Scene(root, 1000, 700);

    primaryStage.setTitle("HID Datapipe USB");
    primaryStage.setScene(scene);
    primaryStage.show();/*from  w  w  w  . j a  va  2  s .  co  m*/

}

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  a  2  s  .c om
    rect.setHeight(100);

    rect.setScaleY(2);
    rectangleGroup.getChildren().add(rect);

    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);
     stage.setTitle("JavaFX Application Life Cycle");
     stage.show();//from  w  w w  .  j av  a2 s  . c om
 }

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setWidth(500);/*from   ww w  . j  ava  2s .  com*/
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();
    CategoryAxis lineXAxis = new CategoryAxis(getData());

    lineXAxis.setStartMargin(1.2);

    root.getChildren().addAll(lineXAxis);
    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);//w w  w  .  j  a  va  2 s.  c om
    stage.setHeight(500);
    Scene scene = new Scene(new Group());
 
    VBox vbox = new VBox(8); // spacing = 8
    vbox.getChildren().addAll(new Button("Cut"), new Button("Copy"), new Button("Paste"));
        
    scene.setRoot(vbox);

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setWidth(500);/*  www.j  a v  a 2 s  .c  om*/
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();
    CategoryAxis lineXAxis = new CategoryAxis(getData());

    lineXAxis.setGapStartAndEnd(true);

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

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

From source file:Main.java

@Override
public void start(Stage stage) {
    VBox box = new VBox();
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);/*from w  w w  .  j a v  a  2s. c  om*/

    Line line = new Line();
    line.setStartX(0.0f);
    line.setStartY(0.0f);
    line.setEndX(100.0f);
    line.setEndY(100.0f);

    line.setEndY(0.4);

    box.getChildren().add(line);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    VBox box = new VBox();
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);//from   w ww  . j  a v a2  s.  co m

    Line line = new Line();
    line.setStartX(0.0f);
    line.setStartY(0.0f);
    line.setEndX(100.0f);
    line.setEndY(100.0f);

    line.setEndX(0.4);

    box.getChildren().add(line);

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

    Circle circle = new Circle();
    circle.setCenterX(100.0f);//  w w  w . j  a  v  a  2 s  . co  m
    circle.setCenterY(100.0f);
    circle.setRadius(50.0f);

    root.getChildren().add(circle);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    VBox box = new VBox();
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);//  ww w. j  a  va2s  .  c  om

    Line line = new Line();
    line.setStartX(0.0f);
    line.setStartY(0.0f);
    line.setEndX(100.0f);
    line.setEndY(100.0f);

    line.setStartX(0.4);

    box.getChildren().add(line);

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