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) {
    FlowPane flowPane = new FlowPane(Orientation.HORIZONTAL, 20, 20);
    flowPane.setPrefWrapLength(210);/*from   w  w w  . j a  va2s  . c o m*/
    Button btn = new Button();

    for (int i = 0; i < 8; i++) {
        btn = new Button("Button");
        btn.setPrefSize(100, 50);
        flowPane.getChildren().add(btn);
    }
    flowPane.setRowValignment(VPos.BASELINE);

    Scene scene = new Scene(flowPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    PieChart pieChart = new PieChart();
    pieChart.setData(getChartData());/*from w  ww. j  a v a  2s .co  m*/

    System.out.println(pieChart.getLabelsVisible());

    pieChart.setTitle("Title");
    pieChart.setLegendSide(Side.LEFT);
    pieChart.setClockwise(false);
    pieChart.setLabelsVisible(false);

    StackPane root = new StackPane();
    root.getChildren().add(pieChart);
    primaryStage.setScene(new Scene(root, 300, 250));
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    PieChart pieChart = new PieChart();
    pieChart.setData(getChartData());//from  w  ww  .  j  a  va 2 s . co  m

    System.out.println(pieChart.clockwiseProperty());

    pieChart.setTitle("Title");
    pieChart.setLegendSide(Side.LEFT);
    pieChart.setClockwise(false);
    pieChart.setLabelsVisible(false);

    StackPane root = new StackPane();
    root.getChildren().add(pieChart);
    primaryStage.setScene(new Scene(root, 300, 250));
    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"));

    final Clipboard clipboard = Clipboard.getSystemClipboard();
    final ClipboardContent content = new ClipboardContent();
    content.putString("some text");
    content.put(DataFormat.PLAIN_TEXT, "other text");
    clipboard.setContent(content);/*from   w w  w  .j  a  v  a2  s .  c o m*/

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

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    PieChart pieChart = new PieChart();
    pieChart.setData(getChartData());// w  w w  .  jav  a  2 s  . co m

    System.out.println(pieChart.getLabelLineLength());

    pieChart.setTitle("Title");
    pieChart.setLegendSide(Side.LEFT);
    pieChart.setClockwise(false);
    pieChart.setLabelsVisible(false);

    StackPane root = new StackPane();
    root.getChildren().add(pieChart);
    primaryStage.setScene(new Scene(root, 300, 250));
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    DoubleProperty translate = new SimpleDoubleProperty();
    stage.setTitle("Hello JavaFX");
    Rectangle node1 = RectangleBuilder.create().x(0).y(0).width(10).height(10).fill(Color.RED).build();
    node1.translateXProperty().bind(translate);

    Parent parent = GroupBuilder.create().children(node1).translateX(250).translateY(250).build();
    stage.setScene(SceneBuilder.create().width(500).height(500).root(parent).build());
    stage.show();

    TimelineBuilder.create().cycleCount(Timeline.INDEFINITE)
            .keyFrames(new KeyFrame(Duration.seconds(0), new KeyValue(translate, -50)),
                    new KeyFrame(Duration.seconds(2), new KeyValue(translate, 250)))
            .build().play();//  w ww  .  j a v a 2s . co m
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    FlowPane flowPane = new FlowPane(Orientation.HORIZONTAL, 20, 20);
    flowPane.setPrefWrapLength(210);//from   www  .  j  ava  2 s  .  c  om
    Button btn = new Button();

    for (int i = 0; i < 8; i++) {
        btn = new Button("Button");
        btn.setPrefSize(100, 50);
        flowPane.getChildren().add(btn);
    }
    System.out.println(flowPane.getAlignment());

    Scene scene = new Scene(flowPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:aajavafx.MedicinesController.java

@FXML
private void handleBackButton(ActionEvent event) {
    try {/* w ww  .  j av  a 2 s . co  m*/

        Node node = (Node) event.getSource();
        Stage stage = (Stage) node.getScene().getWindow();

        FXMLLoader loader = new FXMLLoader(getClass().getResource("MainPage.fxml"));
        Parent root = loader.load();

        Scene scene = new Scene(root);
        stage.setScene(scene);
        stage.show();

        System.out.println("You clicked Schedule!");
    } catch (Exception ex) {

        System.out.println("ERROR! " + ex);
    }

}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    FlowPane flowPane = new FlowPane(Orientation.HORIZONTAL, 20, 20);
    flowPane.setPrefWrapLength(210);/*w ww . j  a  va  2s  . co  m*/
    Button btn = new Button();

    for (int i = 0; i < 8; i++) {
        btn = new Button("Button");
        btn.setPrefSize(100, 50);
        flowPane.getChildren().add(btn);
    }
    System.out.println(flowPane.getOrientation());

    Scene scene = new Scene(flowPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    FlowPane flowPane = new FlowPane(Orientation.HORIZONTAL, 20, 20);
    flowPane.setPrefWrapLength(210);//  www . ja v  a 2  s  .c  o m
    Button btn = new Button();

    for (int i = 0; i < 8; i++) {
        btn = new Button("Button");
        btn.setPrefSize(100, 50);
        flowPane.getChildren().add(btn);
    }
    flowPane.setOrientation(Orientation.HORIZONTAL);

    Scene scene = new Scene(flowPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}