Java Reference
In-Depth Information
787
Chapter 18 Graphical User Interfaces
C HAPTER G OALS
G To understand the use of layout managers to arrange user-interface
components in a container
G To become familiar with common user-interface components, such as buttons,
combo boxes, and menus
G To build programs that handle events from user-interface components
ȗ To learn how to browse the Java documentation
In this chapter, we will delve more deeply into graphical user interface
programming. The graphical applications with which you are familiar have many
visual gadgets for information entry: buttons, scroll bars, menus, etc. In this chapter,
you will learn how to use the most common user-interface components in the Java
Swing user-interface toolkit. Swing has many more components than can be
mastered in a first course, and even the basic components have advanced options that
can't be covered here. In fact, few programmers try to learn everything abou t a
particular user-interface component. It is more important to understand the concepts
and to search the Java documentation for the details. This chapter walks you through
one example to show you how the Java documentation is organized and how you can
rely on it for your programming.
787
788
18.1 Layout Management
Up to now, you have had limited control over the layout of user-interface
components. You learned how to add components to a panel. The panel arranged the
components from the left to the right. However, in many applications, you need more
sophisticated arrangements.
User-interface components are arranged by placing them inside containers.
Containers can be placed inside larger containers.
 
Search WWH ::




Custom Search