import java.awt.*;
class drawFrame extends Frame
{
drawFrame() //constructor
{
setSize(400,400); //sets Frame size
setLocation(500,350); //sets Frame Location
setTitle("Hungry4java"); //sets Title of the frame
setVisible(true); //sets the visible to user
}
public static void main(String[] args)
{
drawFrame f = new drawFrame(); //creating the object of class drawFarme.
}
}
class drawFrame extends Frame
{
drawFrame() //constructor
{
setSize(400,400); //sets Frame size
setLocation(500,350); //sets Frame Location
setTitle("Hungry4java"); //sets Title of the frame
setVisible(true); //sets the visible to user
}
public static void main(String[] args)
{
drawFrame f = new drawFrame(); //creating the object of class drawFarme.
}
}
save your file as frame.java & compile it by writing drawFrame.....using cmd.
ReplyDeletesee the picture above. if you are using eclipse or NetBeansIDE then you can run from there.