Advertisement
Monty374

JFX 6.1

Dec 5th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. package showcircle;
  2.  
  3. import javafx.scene.paint.Color;
  4. import javafx.application.Application;
  5. import javafx.scene.Scene;
  6. import javafx.scene.layout.Pane;
  7. import javafx.scene.shape.Circle;
  8. import javafx.stage.Stage;
  9.  
  10.  
  11. /**
  12. *
  13. * @author Monty
  14. */
  15. public class ShowCircle extends Application{
  16. @Override
  17. public void start(Stage stage1){
  18. Pane pane = new Pane();
  19. Circle circle = new Circle();
  20. circle.centerXProperty().bind(pane.widthProperty().divide(2));
  21. circle.centerYProperty().bind(pane.heightProperty().divide(2));
  22. circle.setRadius(50);
  23. circle.setStroke(Color.BLACK);
  24. Color color = new Color(1,0.1,0.1,0.5);
  25. circle.setFill(color);
  26. pane.getChildren().add (circle);
  27. Scene scene = new Scene(pane, 200, 200);
  28. stage1.setTitle("MyJavaFX");
  29. stage1.setScene(scene);
  30. stage1.show();
  31. }
  32.  
  33. public static void main(String[] args) {
  34. launch(args);
  35. }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement