GUI: Graphical user interface, under AWT and swing package
The difference between AWT and swing
java.awt: the need to invoke the Local System method implementation function, the weight of the control is the degree of association with the system
Javax.swing: On the basis of Java, provides more components, fully implemented by Java, portability, is a lightweight control
Frame: Form Object
Method:
1. Frame: Non-parametric construction
2. Frame.setsize (): Set the form size
3. Frame.setlocation (): Set the form position
4. Frame.setbounds (x,y,width,higth): Combine 2 and 3 with this
5. Frame.setvisible (Boolean): Make the form visible
Closed words in code embodied
Code
Package Cn.idcast;import Java.awt.frame;import Java.awt.event.windowadapter;import java.awt.event.WindowEvent; public class Guidemo {public static void main (string[] args) {frame f = new Frame (); F.setbounds (400, 100, 250, 250);
Close Form F.addwindowlistener (new Windowadapter () {///Windowadapter: Adapter windowlistener listening mechanism @overridepublic void Windowclosing (WindowEvent e) {//TODO auto-generated method stubsystem.exit (0);}}); F.setvisible (True);}}
GUI setup form/close form