Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. public void start(Stage StartingStage) throws Exception{
  2.  
  3. Group root = new Group();
  4. Scene scene = new Scene(root);
  5. Canvas canvas = new Canvas(500, 500);
  6. root.getChildren().add(canvas);
  7. StartingStage.setScene(scene);
  8. StartingStage.show();
  9. GraphicsContext gc = canvas.getGraphicsContext2D();
  10.  
  11. // YOUR STUFF GOES HERE (remove the code below)
  12. StartingStage.setTitle("Constellations Assignment");
  13. gc.strokeOval(100, 50, 200, 200);
  14. gc.fillOval(155, 100, 10, 20);
  15. gc.fillOval(230, 100, 10, 20);
  16. gc.strokeArc(150, 160, 100, 50, 180, 180, ArcType.OPEN);
  17.  
  18. Image img = new Image("Background.jpg", 100, 0, true, true);
  19. gc.drawImage(img, 500,500);
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement