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);//  ww  w .j av  a  2  s. c  o m
    final CheckBox cb = new CheckBox();
    cb.setText("checkBox");
    cb.setAllowIndeterminate(true);

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

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  .ja v a  2s.com*/

    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.setWidth(300);
    stage.setHeight(150);/*from  www  . j  av a 2  s  . c o m*/
    final CheckBox cb = new CheckBox();
    cb.setText("checkBox");
    cb.setAllowIndeterminate(true);

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

    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);//  www .ja  v a2  s .c  o m
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo(50.0f);
    vlt.setY(.7);
    path.getElements().add(vlt);

    System.out.println(vlt.getY());

    root.getChildren().addAll(path);
    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);//  w w  w .j  a v  a2 s .co m
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo();
    vlt.setY(.7);
    path.getElements().add(vlt);

    System.out.println(vlt.yProperty());

    root.getChildren().addAll(path);
    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.java  2 s . c om*/
    final CheckBox cb = new CheckBox();
    cb.setText("checkBox");
    cb.setAllowIndeterminate(true);

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

    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. jav  a2s.  c  om
    final CheckBox cb = new CheckBox();
    cb.setText("checkBox");
    cb.setAllowIndeterminate(true);

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

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setWidth(400);
    stage.setHeight(500);/*from  w  w  w.  ja  v  a2  s.c  o  m*/
    Scene scene = new Scene(new Group());

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

    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setContent(browser);

    browser.getEngine().setOnAlert((WebEvent<String> wEvent) -> {
        System.out.println("Alert Event  -  Message:  " + wEvent.getData());
    });

    webEngine.load("http://java2s.com");

    final WebHistory history = webEngine.getHistory();
    history.getEntries().addListener(new ListChangeListener<WebHistory.Entry>() {
        @Override
        public void onChanged(Change<? extends Entry> c) {
            c.next();
            for (Entry e : c.getRemoved()) {
                System.out.println(e.getUrl());
            }
            for (Entry e : c.getAddedSubList()) {
                System.out.println(e.getUrl());
            }
        }
    });

    history.go(0);
    scene.setRoot(scrollPane);

    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  www.j  av  a2s . c o m
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo(50.0f);
    vlt.setY(.7);
    path.getElements().add(vlt);

    System.out.println(vlt.yProperty());

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

    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);//  ww w .ja v a 2  s.  c  o m
    Scene scene = new Scene(new Group());
    VBox root = new VBox();

    InnerShadow is = new InnerShadow();
    is.setOffsetX(4.0);
    is.setOffsetY(4.0);

    Text t = new Text();
    t.setEffect(is);
    t.setX(20);
    t.setY(100);
    t.setText("java2s.com");
    t.setFill(Color.YELLOW);
    t.setFont(Font.font(null, FontWeight.BOLD, 80));

    root.getChildren().addAll(t);

    scene.setRoot(root);

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