Graphical user interface

Source: Internet
Author: User

GUI applications have 2 sets of api:swing and AWT.SWINGAPI using a large number of AWT classes and interfaces.

Swing contains the two basic elements of containers and components. Among them, the container is divided into top-level container and intermediate container two kinds.

The component is placed in the container. The Java.awtcontainer class is the parent class of the swing component.

The container uses the layout manager to determine how the component is laid out in the container. The layout manager mainly includes:

1 Null Empty layout

2 borderlayout----Boundary layout manager (typically not put directly into components, primarily for placing intermediate containers).

3 FlowLayout---Flow layout (preferably small range).

4 Girdlayout---Grid layout Manager (the number of rows is guaranteed to be the same).

5 CardLayout---card layout manager.

Java GUI programming uses a delegate model to process components and container time. The event source itself does not process the time, but the event handler delegate

To the registered time listener, the event is handled by the method in the time listener.

All events are inherited from the Java.untileventobject class. Each event class xxxevent has a corresponding event listener interface Xxxlistener.

For an event source component to have event handling capabilities, you must first create an event listener object that corresponds to the event generated by the component, and then pass the Addxxxlistener () method

Registers the listener object with the event source. The event listener object must implement the corresponding listener interface, which means that the method defined in the listener interface must be implemented.

Graphical user interface

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.