Guest User

Untitled

a guest
Jan 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. package myjavaprograms;
  2.  
  3. import java.awt.*;
  4. import javax.swing.JFrame;
  5.  
  6. public class ClockFace extends Canvas
  7. {
  8. public void paint( Graphics g )
  9. {
  10. g.setColor(Color.white);
  11. g.fillOval(___,150,300,300);
  12. g.setColor(Color.black);
  13. g.drawOval(250,150,300,300);
  14. g.setColor(Color.gray);
  15. g.fillOval(385, 285, 30, 30);
  16. g.drawString("12", ____, 165);
  17. g.drawString("6", 395, 445);
  18. g.drawString("__", ____, ____);
  19. g.drawString("__", 260, ____);
  20. g.setColor(Color.black);
  21. g.drawLine(400, 165, 400, 300);
  22. g.drawLine(___, 300, ____, 300);
  23. }
  24.  
  25. public static void main( String[] args )
  26. {
  27. JFrame win = new JFrame("Clock Face");
  28. win.setSize(800,600);
  29. win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  30. ClockFace canvas = new ClockFace();
  31. win.add( canvas );
  32. win.setVisible(true);
  33. }
  34. }
Add Comment
Please, Sign In to add comment