Advertisement
mohsentux

JavaFX-Circle

Sep 2nd, 2022
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | Source Code | 0 0
  1. package scenegraph;
  2.  
  3. import javafx.application.Application;
  4. import javafx.scene.Scene;
  5. import javafx.scene.layout.StackPane;
  6. import javafx.scene.paint.Color;
  7. import javafx.scene.shape.Circle;
  8. import javafx.stage.Stage;
  9.  
  10.  
  11. public class SceneGraph extends Application{
  12.    
  13.    
  14.     public void start(Stage primaryStage) {
  15.        
  16.         StackPane root = new StackPane();
  17.         // add a leaf node
  18.         Circle cir = new Circle(200,200,100);
  19.         cir.setFill(Color.CORAL);
  20.         root.getChildren().add(cir);
  21.         Scene scene = new Scene(root, 400, 400);
  22.        
  23.         primaryStage.setTitle("Scene Graph Example");
  24.         primaryStage.setScene(scene);
  25.         primaryStage.show();
  26.        
  27.     }
  28.    
  29.     public static void main(String[] args) {
  30.         launch(args);
  31.     }
  32.  
  33. }
  34.  
Tags: Java JavaFX
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement