import javax.swing.JFrame;
public class HelloWorld extends JFrame{
public static void main(String[]args){
HelloWorld GUI = new HelloWorld();
GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); /* It picks the action to perform when "close" button of the frame is clicked */
GUI.setSize(300,300); // It makes the rectangular area 300 pixels wide by 300 pixels high
GUI.setVisible(true); // It makes the frame appear on the screen
GUI.setTitle("Introduction to GUI"); // It is for giving title in the frame
}
}
OUTPUT:
public class HelloWorld extends JFrame{
public static void main(String[]args){
HelloWorld GUI = new HelloWorld();
GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); /* It picks the action to perform when "close" button of the frame is clicked */
GUI.setSize(300,300); // It makes the rectangular area 300 pixels wide by 300 pixels high
GUI.setVisible(true); // It makes the frame appear on the screen
GUI.setTitle("Introduction to GUI"); // It is for giving title in the frame
}
}
OUTPUT:
No comments:
Post a Comment