Search This Blog

Friday, November 19, 2010

How to Draw Rectangle in Applet


/*********************
 *Program by Kashid
 *Created on July 2005
 *********************/







import java.awt.*;
import java.applet.Applet;

public class AwtRect extends Applet
{
/*<Applet code="AwtRect.class" height=200 width=200>
   </Applet>
*/



public void paint(Graphics g)
{
g.setColor(Color.orange);
g.fillRect(10,10,150,150);
g.setColor(Color.red);
g.fillRect(30,30,155,155);


}
}

0 comments:

Post a Comment