Advertisement
kimh_greenhill

Exercise Problem 2 Chapter 3G

Jan 29th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. /**
  2. * Exercise 2 Chapter 3G
  3. *
  4. * Hannah Kim
  5. * January 29, 3015
  6. */
  7.  
  8. import java.awt.*;
  9. import java.applet.*;
  10.  
  11. public class drawFigure extends Applet
  12. {
  13. public void paint(Graphics g)
  14. {
  15. g.setColor(Color.red);
  16. g.fillOval(50, 25, 40, 40);
  17. g.setColor(Color.red);
  18. g.fillOval(125, 25, 40, 40);
  19. g.setColor(Color.gray);
  20. g.fillRect(70, 44, 77, 77);
  21. g.setColor(Color.black);
  22. g.drawLine(70, 82, 147, 82);
  23. g.setColor(Color.red);
  24. g.fillOval(250, 40, 40, 40);
  25. g.setColor(Color.red);
  26. g.fillOval(325, 40, 40, 40);
  27. g.setColor(Color.gray);
  28. g.fillRect(270, 59, 77, 77);
  29. g.setColor(Color.black);
  30. g.drawLine(270, 97, 347, 97);
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement