Guest User

Untitled

a guest
Feb 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. import java.lang.System.*;
  2. import java.util.*;
  3. import java.awt.*;
  4.  
  5. public class WHALE
  6. {
  7. public static void main(String[] args)
  8. {
  9. new SketchPad();
  10. }
  11. }
  12.  
  13. class SketchPad extends JFrame
  14. {
  15. public void paint(Graphics screen)
  16. {
  17. whale(screen,50,100);
  18. }
  19.  
  20. public void whale(Graphics g, int x, int y)
  21. {
  22. g.setColor(new Color(6,174,255));
  23. int xPoints[] = {x+16,x+27,x+42,x+50,x+49,x+64,x+75,
  24. x+86,x+99,x+109,x+114,x+112,x+102,x+88,x+76,x+63,x+61,
  25. x+63,x+67,x+85,x+99,x+119,x+132,x+141,x+155,x+171,x+191,
  26. x+216,x+240,x+258,x+281,x+290,x+298,x+299,x+293,x+274,x+250,
  27. x+184,x+70,x+49,x+33,x+29,x+38,x+40,x+28,x+17,x+2,x+2,x+2};
  28.  
  29. int yPoints[] = {y+44 ,y+41,y+49,y+62,y+75,y+64,y+56,y+45,
  30. y+52,y+61,y+75,y+92,y+107,y+99,y+92,y+97,y+112,y+128,y+146,
  31. y+158,y+155,y+139,y+117,y+103,y+84,y+76,y+72,y+68,y+69,y+73,y+89,
  32. y+104,y+124,y+167,y+190,y+203,y+215,y+226,y+227,y+217,y+202,y+146,
  33. y+108,y+92,y+84,y+89,y+97,y+73,y+57};
  34.  
  35. int numOfPoints = 49;
  36. g.fillPolygon(xPoints,yPoints,numOfPoints);
  37. }
  38. }
Add Comment
Please, Sign In to add comment