Java GUI programming (Graphic user Interface, graphical user interface) is implemented on its Abstract Window Toolkit (abstract Windows TOOLKIT,AWT). java.awt is the AWT Tool class library, which includes rich graphics, user interface components, and layout manager support.
The GUI is mainly used in two places:
Application;
Applet.
1 GUI Interface:
A control panel in which a user interacts with a program, containing a menu, control (or component), and a container that responds to the user's events.
There are a wide variety of window systems, and different Windows systems provide a big difference to the program libraries that are programmed, for example, Windows-based SDK, and Xlib of the UNIX platform based on X windows.
In order for the program to run under different window systems, Java proposes the concept of "abstract Window System", which provides the AWT (Abstract window Toolbox) that enables Java to run under different window systems.
2 GUI implementation in Java:
Use AWT (abstract window toolset) to make the GUI suitable for different OS environments.
Features are as follows:
① its implementation is explained by the OS under the target platform, which results in different effects of the Java GUI on different platforms (the display of window appearance, font, etc.).
② components should not use absolute positioning in design, but should use Layout manager to achieve relative positioning to achieve platform and device-independent.
3 New Swing GUI components
AWT components and event responses are not as rich as Microsoft's SDK (because some OS platforms do not have Microsoft's Windows components), Sun has added swing GUI components to JAVA2. However, AWT is simple and features can meet most of the interface requirements, especially in Java applets designed to be widely used. At the same time, this discussion has also laid a solid foundation for us to further study the swing GUI components.