Hi Deekasha,
Can you tell me why the following code is giving compilation error.
Thanks for your time.
Sakthivel.
----------------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
class Drawing extends Frame
{
public static void main(
String h[])
{
Drawing dr = new Drawing();
dr.setSize(300,300);
dr.setVisible(true);
addWindowListener(new WindowHandler());
}
public void paint(Graphics g)
{
g.drawRect(0,0,200,100);
g.setColor(Color.cyan);
g.fillRect(50,50,150,50);
g.setColor(Color.black);
g.drawString("Hello Sabapathy",60,60);
g.drawOval(100,100,25,25);
g.setColor(Color.red);
g.fillOval(100,100,15,15);
}
class WindowHandler extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}
}