Welcome To The World Of Hacking


Learn Hacking|Teach Hacking|Learn To Secure|Learn To Code

Saturday

JAVA PROGRAMMING TUTORIAL 21: INTRODUCTION TO GRAPHICAL USER INTERFACE(GUI)

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:



No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...