Friday, 14 June 2013

program in java - draw rectangle with awt

import java.awt.*;
class a3 extends Frame
{
    public static void main(String args[])
    {
        a3 a=new a3();
        a.setTitle("Rectangle");
        a.setSize(500,500);
        a.setVisible(true);
        //a.show();
    }
    public void paint(Graphics g)
    {
        g.drawRect(100,100,300,300);

        g.drawRect(60,100,80,150);

        g.drawRect(180,180,200,200);
    }
}

No comments: