AWT: Abstract window Toolbox, which consists of three parts:
① components: interface elements;
② container: A container for loading components (such as a form);
③ Layout Manager: Responsible for determining the placement of components in a container.
The application of the graphical interface is in four steps:
① Select a container:
⑴window: A container with a title (such as frame);
⑵panel: Panel
Add components to the container through Add ().
Java's graphical interface is still cross-platform. However, when a form is called, only one form is generated, no event is processed, and the Close button does not work. Only use CTRL + C to terminate the program at this time.
② setting up a layout manager: With setlayout ();
③ adding components to the container;
1 Packagetomtexts;2 3 Public classtomtexts_19 {4 Public Static voidMain (string[] args)5{//using basic data Types6 DoubleD = 0.7E-3; 7 inti = 1000;8 byteB = 55;9 Shorts = 500;TenDouble dd=NewDouble (d); One //using constructors to generate objects of a basic data type class AInteger ii=NewInteger (i); -Byte bb=NewByte (b); -Short ss=NewShort (s); theLong ll=NewLong (50000L); -Character cc=NewCharacter (' a '); -Float ff=NewFloat (0.23F); -Boolean bbool=NewBoolean (true); + //gets the basic type data in the object - Doublex=Dd.doublevalue (); + inty=Ii.intvalue (); A System.out.println (x); at System.out.println (y); - System.out.println (Bb.bytevalue ()); - System.out.println (Ss.shortvalue ()); - System.out.println (Ll.longvalue ()); - System.out.println (Cc.charvalue ()); - System.out.println (Ff.floatvalue ()); in System.out.println (Bbool.booleanvalue ()); - //converts a numeric value from a base data type class to a string to System.out.println (ii.tostring ()); + System.out.println (ff.tostring ()); - System.out.println (dd.tostring ()); the System.out.println (ll.tostring ()); * System.out.println (ii); $ System.out.println (FF);Panax Notoginseng //integer si= New Integer ("a"); - //System.out.println (Si.intvalue ()); the } + A}
Java's graphical interface is still a cross-platform