Advertisement
Guest User

Chapter 14.5

a guest
Nov 28th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. /**
  2. * Jaclyn Jardell
  3. * Chapter 14.5 Program
  4. *
  5. * @(#)Chapter14.5Program.java
  6. *
  7. * Chapter14.5Program Applet application
  8. *
  9. * @author
  10. * @version 1.00 2014/11/23
  11. */
  12. import java.awt.*;
  13. import java.applet.*;
  14.  
  15. public class Chapter14_5Program extends Applet
  16. {
  17.  
  18. public void init()
  19. {
  20. }
  21.  
  22. public void paint(Graphics g) {
  23.  
  24. g.drawString("Welcome to Java!!", 50, 60 );
  25. boolean onOff = true;
  26. int x;
  27. int y;
  28. int heightWidth;
  29.  
  30. g.setColor(Color.blue);
  31. g.drawOval(0, 0, 500, 500);
  32. g.drawOval(0, 500, 500, 0);
  33.  
  34. for(x = 250; y = 250; heightWidth= 10; x > 10; x-= 10; y -= 10; heightWidth += 20)
  35. {
  36. g.drawOval(x, y, heightWidth, heightWidth);
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement