5.1 Graphical user interface (GUI)
GUI is a graphic way, the use of menus, buttons and other standard interface elements and mouse operation, to help users easily to the computer system to issue instructions, start the operation, and the results of the system run the same way to display the user's technology.
AWT (Abstract Window Toolkit)
AWT is an abstract window toolkit, which is the Java language API for building a graphical user interface. Its
Key features include:
? User interface Components
? Event Processing Model
? Graphics and imaging tools
? Layout Manager
Packages related to the graphical user interface
Z java.awt classes related to drawing
Z java.awt.event classes related to event handling
Z javax.swing classes related to swing components
Container
There are two main types of swing containers commonly used:
Z Top-level container: A container that contains other components and containers.
Each application should have a top-level container. Main
To have: Jframe, JApplet and JDialog.
Z Generic container: Refers to the middle tier container. There are mainly JPanel,
JScrollPane (panel with scroll bar) and JToolBar.
Places to be aware of using top-level containers
Z each GUI component must be in one and only one capacity
The device.
Z Each top-level container contains a content pane
(Content pane), all components must be placed
In the Contents pane.
Z can add a menu bar to the top-level container, which will
The contract position of the top-level pane.
Java Learning Note 2