Example usage for javafx.stage Stage setWidth

List of usage examples for javafx.stage Stage setWidth

Introduction

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

Prototype

public final void setWidth(double value) 

Source Link

Usage

From source file:Main.java

License:asdf

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

    FlowPane flow = new FlowPane(Orientation.VERTICAL);
    flow.setVgap(8);
    flow.setHgap(4);
    flow.setPrefWrapLength(300); // preferred width = 300
    for (int i = 0; i < 10; i++) {
        flow.getChildren().add(new Button("asdf"));
    }
    scene.setRoot(flow);

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

From source file:Main.java

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

    VBox root = new VBox();

    NumberAxis yAxis = new NumberAxis(0.0, 5.0, 1.0);
    NumberAxis xAxis = new NumberAxis(0.0, 5.0, 1.0);
    ScatterChart scatterChart = new ScatterChart(xAxis, yAxis);

    root.getChildren().addAll(scatterChart);
    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);
    stage.setHeight(500);/*from w w  w. j a v  a  2s  .  c o  m*/
    Scene scene = new Scene(new Group());

    VBox vbox = new VBox();
    ListView list = new ListView();
    VBox.setVgrow(list, Priority.ALWAYS);
    vbox.getChildren().addAll(new Label("Names:"), list);

    scene.setRoot(vbox);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);
    stage.setHeight(500);/*from w  ww . j  av a2 s.  c  om*/
    Scene scene = new Scene(new Group());
    VBox root = new VBox();

    Hyperlink hpl = new Hyperlink("java2s.com");

    hpl.setFont(Font.font("Arial", 14));

    root.getChildren().addAll(hpl);

    scene.setRoot(root);

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("");
    stage.setWidth(500);
    stage.setHeight(500);//from   www  .  j a va  2 s. co m
    Scene scene = new Scene(new Group());

    VBox root = new VBox();
    NumberAxis lineYAxis = new NumberAxis(0, 100, 10);
    CategoryAxis lineXAxis = new CategoryAxis();

    lineYAxis.setLabel("Sales");
    lineXAxis.setLabel("Products");

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

    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);
    stage.setHeight(150);/* ww  w  .  j a  va 2 s .  c o  m*/

    ToolBar toolBar = new ToolBar(new Button("New"), new Button("Open"), new Button("Save"), new Separator(),
            new Button("Clean"), new Button("Compile"), new Button("Run"), new Separator(), new Button("Debug"),
            new Button("Profile"));
    System.out.println(toolBar.getItems());
    ((Group) scene.getRoot()).getChildren().add(toolBar);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);
    stage.setHeight(500);// www. ja  va 2s  .  c om
    Scene scene = new Scene(new Group());
    VBox root = new VBox();

    final ImageView selectedImage = new ImageView();
    Image image1 = new Image(Main.class.getResourceAsStream("a.jpg"));
    selectedImage.setImage(image1);

    selectedImage.setRotate(90);

    root.getChildren().addAll(selectedImage);

    scene.setRoot(root);

    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);
    stage.setHeight(150);/* w  ww  .jav  a  2s. c  o m*/

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");
    System.out.println(toolTip.getGraphicTextGap());
    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);
    stage.setHeight(150);/*from ww  w  .j  a  va  2  s  . com*/

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");
    System.out.println(toolTip.getContentDisplay());
    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);
    stage.setHeight(150);//  ww  w  . j  a  va2 s .  com

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");
    System.out.println(toolTip.graphicProperty());
    button.setTooltip(toolTip);

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

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