0% found this document useful (0 votes)
168 views

Heisenberg Java

This Java applet code draws a complex polygon figure using fillPolygon, fillArc, fillRect, and fillOval methods. It defines arrays of x and y coordinates that are used to draw different polygon and arc shapes with the Graphics object. The applet sets a white background and draws the figure using black color, also including some inner white oval shapes.

Uploaded by

shenoy_L
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
168 views

Heisenberg Java

This Java applet code draws a complex polygon figure using fillPolygon, fillArc, fillRect, and fillOval methods. It defines arrays of x and y coordinates that are used to draw different polygon and arc shapes with the Graphics object. The applet sets a white background and draws the figure using black color, also including some inner white oval shapes.

Uploaded by

shenoy_L
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.applet.

*;
import java.awt.*;
/*<applet CODE = Exp20.class
HEIGHT = 485
WIDTH = 570>
</applet>*/
public class Exp20 extends Applet
{
public void init()
{
setBackground(Color.white);
}
public void paint(Graphics g)
{
g.setColor(Color.black);
int a[]={104,157,170,194,378,388,397,461,112};
int b[]={115,120,10,0,6,16,108,121,128};
g.fillPolygon(a,b,9);
g.fillArc(103,67,359,89,350,-155);
int c[]={169,176,393,400,390,283,176};
int d[]={173,168,168,173,201,187,201};
g.fillPolygon(c,d,7);
g.fillArc(169,138,79,96,0,-200);
g.fillArc(319,138,79,96,20,-200);
g.fillRect(200,189,52,47);
g.fillRect(311,189,52,47);
int e[]={252,270,277,283,289,296,310,363,252};
int f[]={236,226,192,189,192,226,236,179,179};
g.fillPolygon(e,f,9);
g.fillOval(212,260,145,134);
g.setColor(Color.white);
g.fillOval(178,280,44,85);
g.fillOval(346,299,37,52);
g.fillOval(345,335,42,61);
int h[]={192,386,350,340,326,319,312,306,298,293,286,277,270,264,252,245
,237,232,219};
int i[]={245,245,310,286,288,278,284,278,282,274,280,274,284,275,283,278
,293,286,302};
g.fillPolygon(h,i,19);
g.fillOval(232,298,98,60);
g.setColor(Color.black);

int j[]={278,226,234,256,255,261,280,296,310,318};
int k[]={386,355,335,347,339,325,318,323,345,348};
g.fillPolygon(j,k,10);
int l[]={245,244,251,258,271,291,299,312,335,333};
int m[]={292,309,310,305,310,312,307,310,309,293};
g.fillPolygon(l,m,10);
}
}

You might also like