daniel_lawson9999

Java AP Assignment (applet)

Sep 1st, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. /**
  2. * Created by Daniel on 8/31/2016.
  3. */
  4. import java.awt.*;
  5. import java.applet.*;
  6. public class Lab04b extends Applet {
  7. public void paint(Graphics g){
  8. g.drawRect(50,50,300,300);
  9. g.drawLine(50,50,150,150);
  10. g.drawLine(350,50,450,150);
  11. g.drawRect(150,150,300,300);
  12. g.drawLine(50,350,150,450);
  13. g.drawLine(350,350,450,450);
  14.  
  15. for(int n = 0; n < 4;n++)g.drawOval(600,50+n*40,320,320 - n*80);
  16. for(int n = 0;n<4;n++)g.drawOval(600+n*40,50,320- n*80,320);
  17.  
  18. g.drawOval(750,350,270,270);
  19. g.drawLine(885,620,750,485);
  20. // g.drawLine(817,552,980,389);
  21. g.drawLine(980,389,750,485);
  22. g.drawLine(885,620,980,389);
  23. g.drawOval(799,443,128,128);//795,417,135,135
  24.  
  25. g.fillRect(50,500,20,100);
  26. g.fillRect(90,500,20,100);
  27. g.fillRect(50,500,60,20);
  28. g.fillRect(50,540,60,20);//
  29. g.fillRect(50+80,500,60,20);
  30. g.fillRect(130,540,60,20);
  31. g.fillRect(130,500,20,100);
  32. g.fillRect(130+40,500,20,60);//
  33. g.fillRect(210,500,20,100);
  34. g.fillRect(210,500,60,20);
  35. g.fillRect(210,580,60,20);//
  36. g.fillRect(290,500,60,20);
  37. g.fillRect(290,500,20,60);
  38. g.fillRect(290,540,60,20);
  39. g.fillRect(330,540,20,60);
  40. g.fillRect(290,580,60,20);
  41.  
  42. g.fillArc(500,480,90,90,135,-270);
  43. g.fillArc(560,420,90,90,135,270);
  44. g.fillArc(620,480,90,90,45,270);
  45. g.fillArc(560,540,90,90,225,-270);
  46.  
  47.  
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment