Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.lang.System.*;
- import java.util.*;
- import java.awt.*;
- import java.awt.event.*;
- public class WHALE
- {
- public static void main(String[] args)
- {
- new SketchPad();
- }
- }
- class SketchPad extends JFrame
- {
- SketchPad()
- {
- Color blue = new Color(34, 68, 180);
- setBackground(blue);
- setTitle("SketchPad");
- setSize(600,400);
- setResizable(false);
- setLocationRelativeTo(null);
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- setVisible(true);
- }
- public void paint(Graphics screen)
- {
- whale(screen,50,100);
- }
- public void whale(Graphics g, int x, int y)
- {
- g.setColor(new Color(6,174,255));
- int xPoints[] = {x+16,x+27,x+42,x+50,x+49,x+64,x+75,
- x+86,x+99,x+109,x+114,x+112,x+102,x+88,x+76,x+63,x+61,
- x+63,x+67,x+85,x+99,x+119,x+132,x+141,x+155,x+171,x+191,
- x+216,x+240,x+258,x+281,x+290,x+298,x+299,x+293,x+274,x+250,
- x+184,x+70,x+49,x+33,x+29,x+38,x+40,x+28,x+17,x+2,x+2,x+2};
- int yPoints[] = {y+44 ,y+41,y+49,y+62,y+75,y+64,y+56,y+45,
- y+52,y+61,y+75,y+92,y+107,y+99,y+92,y+97,y+112,y+128,y+146,
- y+158,y+155,y+139,y+117,y+103,y+84,y+76,y+72,y+68,y+69,y+73,y+89,
- y+104,y+124,y+167,y+190,y+203,y+215,y+226,y+227,y+217,y+202,y+146,
- y+108,y+92,y+84,y+89,y+97,y+73,y+57};
- int numOfPoints = 49;
- g.fillPolygon(xPoints,yPoints,numOfPoints);
- }
- }
Add Comment
Please, Sign In to add comment