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);//from   w  w w .  j a  v  a 2 s.  c o m

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

    toolTip.setTextAlignment(TextAlignment.CENTER);

    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);/*www  .  java  2s  .  c o m*/

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");
    Node icon = new ImageView(new Image(getClass().getResourceAsStream("root.png")));
    toolTip.setGraphic(icon);

    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  v  a2 s.  c  o  m

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

    System.out.println(toolTip.graphicTextGapProperty());

    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) {
    stage.setTitle("HTML");
    stage.setWidth(500);
    stage.setHeight(500);/*from w w w  . ja 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();
    Hyperlink hpl = new Hyperlink("java2s.com");
    hpl.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            webEngine.load("http://java2s.com");
        }
    });

    root.getChildren().addAll(hpl, browser);
    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   www.j  av  a2 s  .c  om

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

    toolTip.setWrapText(true);

    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 va 2  s. co  m

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

    toolTip.setTextOverrun(OverrunStyle.CENTER_ELLIPSIS);

    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 a2  s .  c  o m*/

    Button button = new Button("Hover Over Me");
    Tooltip toolTip = new Tooltip("Tooltip for Button");
    toolTip.setFont(Font.font("", 0.5));

    System.out.println(toolTip.isWrapText());

    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("HTML");
    stage.setWidth(500);
    stage.setHeight(500);//  w  ww . j  ava 2s  .  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);

    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(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);
    stage.setHeight(150);//from ww w. j  av  a  2s . c om
    final CheckBox cb = new CheckBox();
    cb.setText("checkBox");
    cb.setSelected(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);// w w  w .  j  av a2s  .  c  o  m
    final CheckBox cb = new CheckBox();
    cb.setText("checkBox");
    cb.setAllowIndeterminate(true);

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