List of usage examples for javafx.stage Stage show
@Override public final void show()
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 260, 80); stage.setScene(scene);//from www.jav a 2 s . c om Group g = new Group(); Polyline polyline = new Polyline(); polyline.getPoints().addAll(new Double[] { 0.0, 0.0, 20.0, 10.0, 10.0, 20.0 }); g.getChildren().add(polyline); scene.setRoot(g); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { ChoiceBox<String> choiceBox = new ChoiceBox<String>(); choiceBox.setItems(cursors);/* w ww . ja v a 2 s.co m*/ System.out.println(choiceBox.showingProperty()); VBox box = new VBox(); box.getChildren().add(choiceBox); final Scene scene = new Scene(box, 300, 250); scene.setFill(null); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { initializeComponents();//from w w w . j av a2 s .c om initializeListeners(); buildGUI(); populateData(); primaryStage.setScene(new Scene(rootPane, 400, 325)); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 300, 150); stage.setScene(scene);//from w ww. j av a 2 s . co m stage.setTitle("Sample"); final int totalIterations = 90; IteratingTask task = new IteratingTask(totalIterations); task.run(); System.out.println(task.getMessage()); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { TextArea myTextArea = new TextArea(); VBox hbox = new VBox(); hbox.getChildren().add(myTextArea); VBox.setVgrow(myTextArea, Priority.ALWAYS); Scene scene = new Scene(hbox, 320, 112, Color.rgb(0, 0, 0, 0)); primaryStage.setScene(scene);//from ww w . java2 s . c o m primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Button okBtn = new Button("OK"); Button cancelBtn = new Button("Cancel"); cancelBtn.setPrefWidth(100);//from ww w.j a v a2 s . c o m VBox root = new VBox(); root.getChildren().addAll(okBtn, cancelBtn); Scene scene = new Scene(root); stage.setScene(scene); stage.setTitle("Overriding Node Sizes"); stage.show(); System.out.println("okBtn.getPrefWidth(): " + okBtn.getPrefWidth()); System.out.println("okBtn.getMinWidth(): " + okBtn.getMinWidth()); System.out.println("okBtn.getMaxWidth(): " + okBtn.getMaxWidth()); System.out.println("cancelBtn.getPrefWidth(): " + cancelBtn.getPrefWidth()); System.out.println("cancelBtn.getMinWidth(): " + cancelBtn.getMinWidth()); System.out.println("cancelBtn.getMaxWidth(): " + cancelBtn.getMaxWidth()); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 500, 200); stage.setScene(scene);/* ww w . j a v a 2 s .c om*/ Rectangle rect = new Rectangle(200, 200, Color.RED); ScrollPane s1 = new ScrollPane(); s1.setPannable(true); s1.setPrefSize(120, 120); s1.setContent(rect); root.getChildren().add(s1); stage.show(); }
From source file:Main.java
@Override public void start(final Stage stage) { stage.setTitle("HTML"); stage.setWidth(500);/*from ww w . j a va 2s . c o m*/ stage.setHeight(500); Scene scene = new Scene(new Group()); VBox vbox = new VBox(8); // spacing = 8 vbox.getChildren().addAll(new Button("Cut"), new Button("Copy"), new Button("Paste")); scene.setRoot(vbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { VBox box = new VBox(); final Scene scene = new Scene(box, 300, 250); scene.setFill(null);// w w w. j a v a 2s .c o m Line line = new Line(0, 0, 0, 0); line.setStartX(0.0f); line.setStartY(0.0f); line.setEndX(100.0f); line.setEndY(100.0f); box.getChildren().add(line); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Button openURLButton = new Button("Go!"); openURLButton.setOnAction(e -> {/* w w w . ja v a 2 s . co m*/ HostServices host = getHostServices(); JSObject js = host.getWebContext(); if (js == null) { Stage s = new Stage(StageStyle.UTILITY); s.initModality(Modality.WINDOW_MODAL); Label msgLabel = new Label("This is an FX alert!"); Group root = new Group(msgLabel); Scene scene = new Scene(root); s.setScene(scene); s.setTitle("FX Alert"); s.show(); } else { js.eval("window.alert('This is a JavaScript alert!')"); } }); Scene scene = new Scene(openURLButton); stage.setScene(scene); stage.setTitle("Knowing the Host"); stage.show(); }