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

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

    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(final Stage stage) {
    stage.setTitle("");
    stage.setWidth(500);
    stage.setHeight(500);//  www.j ava  2  s  .c o  m
    Scene scene = new Scene(new Group());

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

    BarChart barChart = new BarChart(lineXAxis, lineYAxis);

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

    root.getChildren().addAll(barChart);
    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);//from ww w  . jav a  2  s. co  m

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

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

    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"));
    toolBar.setOrientation(Orientation.HORIZONTAL);

    System.out.println(toolBar.orientationProperty());
    ((Group) scene.getRoot()).getChildren().add(toolBar);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setWidth(400);
    stage.setHeight(180);//from w  w  w.ja  v a 2s .c om

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

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip();
    toolTip.setContentDisplay(ContentDisplay.BOTTOM);

    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 .ja v a 2 s  .  c  o  m

    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);
    stage.setHeight(150);//w w  w  .ja  v  a 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"));
    toolBar.setOrientation(Orientation.HORIZONTAL);

    System.out.println(toolBar.getOrientation());
    ((Group) scene.getRoot()).getChildren().add(toolBar);

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

From source file:Main.java

License:asdf

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

    VBox root = new VBox();

    final WebView browser = new WebView();
    final WebEngine webEngine = browser.getEngine();

    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setStyle("-fx-background-color: white");

    scrollPane.setContent(browser);
    webEngine.loadContent("<b>asdf</b>");

    root.getChildren().addAll(scrollPane);
    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  w w.java  2 s.c  o m
    final CheckBox cb = new CheckBox();
    cb.setText("checkBox");

    cb.selectedProperty().addListener(new ChangeListener<Boolean>() {
        public void changed(ObservableValue<? extends Boolean> ov, Boolean old_val, Boolean new_val) {
            System.out.println(cb.isSelected());
        }
    });
    ((Group) scene.getRoot()).getChildren().add(cb);

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