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.
}
}
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxzR9egRrKrwylaIn4_MHzlSfeTRTBe_jLkJEtiLb6mx_Pu4_TZcpG6-idJlQF5KCLH1eomkaleFf1nvLn_rsTfRCBROJ1Gh4elMoXx8hFyUIKXL_Wi9vHyQE3BE0G8t7OOcr3stHElXM/s1600/Compile.PNG)
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.