List of usage examples for javafx.stage Stage setScene
@Override final public void setScene(Scene value)
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Title"); final Circle circ = new Circle(40); final Group root = new Group(circ); final Scene scene = new Scene(root, 400, 300); primaryStage.setScene(scene); primaryStage.show();/* www. ja v a 2 s . c o m*/ }
From source file:Main.java
@Override public void start(Stage stage) { Button b1 = new Button("Close"); b1.setEffect(new DropShadow()); VBox root = new VBox(); root.getChildren().addAll(b1);// ww w . j a v a 2s.c om Scene scene = new Scene(root); stage.setScene(scene); stage.setTitle("Testing LayoutBounds"); stage.show(); }
From source file:memoryaid.GalleryController.java
@FXML private void uploadImageAction(ActionEvent event) throws IOException { String imgPath = imagePathText.getText(); String baseName = FilenameUtils.getBaseName(imgPath); String destinationPath = "/Users/madhaviunnam/NetBeansProjects/MemoryAid/src/GalleryImages"; File destinationPathObject = new File(destinationPath + "/" + baseName + ".png"); File sourceFilePathObject = new File(imgPath); FileUtils.copyFile(sourceFilePathObject, destinationPathObject); Parent Gallery = FXMLLoader.load(getClass().getResource("Gallery1.fxml")); Scene Gallery_scene = new Scene(Gallery); Stage app_stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); app_stage.hide();/*from w w w . j a v a2 s. c o m*/ app_stage.setScene(Gallery_scene); app_stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Arc arc = new Arc(0, 0, 50, 100, 0, 90); arc.setFill(Color.TRANSPARENT); arc.setStroke(Color.BLACK);//from w ww .j a va 2 s. c o m HBox box = new HBox(arc); Scene scene = new Scene(box); stage.setScene(scene); stage.setTitle("Test"); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Title"); final Circle circ = new Circle(40, 40, 30); final Group root = new Group(circ); final Scene scene = new Scene(root, 400, 300); primaryStage.setScene(scene); primaryStage.show();/* w w w . j a v a 2s . c o m*/ }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Title"); final Circle circ = new Circle(40, Color.RED); final Group root = new Group(circ); final Scene scene = new Scene(root, 400, 300); primaryStage.setScene(scene); primaryStage.show();/* w w w.j a v a 2 s . c om*/ }
From source file:Main.java
@Override public void start(Stage primaryStage) { Group root = new Group(); Scene scene = new Scene(root, 800, 600, Color.BLACK); primaryStage.setScene(scene); Group circles = new Group(); for (int i = 0; i < 30; i++) { Circle circle = new Circle(150, Color.web("white", 0.05)); circle.setStrokeType(StrokeType.OUTSIDE); circle.setStroke(Color.web("white", 0.16)); circle.setStrokeWidth(4);/*from w w w . j av a2s . co m*/ circles.getChildren().add(circle); } Rectangle colors = new Rectangle(scene.getWidth(), scene.getHeight(), new LinearGradient(0f, 1f, 1f, 0f, true, CycleMethod.NO_CYCLE, new Stop[] { new Stop(0, Color.web("#f8bd55")), new Stop(0.14, Color.web("#c0fe56")), new Stop(0.28, Color.web("#5dfbc1")), new Stop(0.43, Color.web("#64c2f8")), new Stop(0.57, Color.web("#be4af7")), new Stop(0.71, Color.web("#ed5fc2")), new Stop(0.85, Color.web("#ef504c")), new Stop(1, Color.web("#f2660f")), })); Group blendModeGroup = new Group( new Group(new Rectangle(scene.getWidth(), scene.getHeight(), Color.BLACK), circles), colors); colors.setBlendMode(BlendMode.OVERLAY); root.getChildren().add(blendModeGroup); circles.setEffect(new BoxBlur(10, 10, 3)); Timeline timeline = new Timeline(); for (Node circle : circles.getChildren()) { timeline.getKeyFrames().addAll(new KeyFrame(Duration.ZERO, // set start position at 0 new KeyValue(circle.translateXProperty(), random() * 800), new KeyValue(circle.translateYProperty(), random() * 600)), new KeyFrame(new Duration(40000), // set end position at 40s new KeyValue(circle.translateXProperty(), random() * 800), new KeyValue(circle.translateYProperty(), random() * 600))); } // play 40s of animation timeline.play(); primaryStage.show(); }
From source file:Main.java
@Override public void start(final Stage primaryStage) { primaryStage.setTitle("Dialog"); Group root = new Group(); Scene scene = new Scene(root, 400, 300, Color.WHITE); primaryStage.setScene(scene); primaryStage.show();// ww w . j ava 2s . co m Stage myDialog = new MyDialog(primaryStage); myDialog.sizeToScene(); myDialog.show(); }
From source file:Main.java
@Override public void start(Stage stage) { ChoiceBox choiceBox = new ChoiceBox(); VBox box = new VBox(); box.getChildren().add(choiceBox);// w ww . j a va 2 s. c om 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) { primaryStage.setTitle("Title"); final Circle circ = new Circle(40, 30, 20, Color.RED); final Group root = new Group(circ); final Scene scene = new Scene(root, 400, 300); primaryStage.setScene(scene); primaryStage.show();/* w ww .ja v a 2s. c om*/ }