Friday, 27 May 2011

java applet drawing


// 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);
}
}

Post a Comment