Code:
Import
java.applet.*;
importjava.awt.*;
public
class Draw extends java.applet.Applet
{
intxCoords[]
= { 50, 200, 300, 150, 50, 50 };
intyCoords[]
= { 100, 0, 50, 300, 200, 100 };
public
void paint(Graphics g)
{
g.drawString("Polygon",50,50);
g.drawPolygon(xCoords,
yCoords, 6);
}
/*
<applet code=Draw width=300 height=300>
</applet>
Comments
Post a Comment