SQL

Friday, 22 January 2016

GUI 1 Simple sub class of JFrame

This is a simple GUI application. It has no text or image attached to it. You may say this is the basic JFrame subclass which has a fixed width, height and X,Y origin.






It is a good practice to use setDefaultCloseOperation(EXIT_ON_CLOSE); Otherwise even if you close the frame window , the compiler will be still running indefinitely.

The method such setTitle, setSize , setLocation and setDefaultCloseOperation are defined on its super class. We can call those inherited method using dot (.) or withot dot (.). If we use dot then we have to use this keyword. setLocation is the x and Y coordinate of the screen.

Post a Comment