Java's graphical interface is still a cross-platform

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.