// Drawing polygon
import java.awt.*;
import java.applet.*;
/* <applet code="hourglass" width=500 height=400 > </applet> */
public class hourglass extends Applet {
public void paint(Graphics g) {
int xpoints[]={30,200,30,200,30};
int ypoints[]={30,20,200,200,30};
int num=5;
g.drawPolygon(xpoints,ypoints,num);
}
}
No comments:
Post a Comment