Java Reference
In-Depth Information
CHAPTER
12
An Introduction to
GUI Programming
We are now ready to discuss one of my favorite aspects of Java: GUI program-
ming. I started my programming career as a Windows programmer using
Visual C++ and MFC, which can take months to learn how to use and longer to
understand. When I learned how to write GUI programs in Java, I was relieved
to find that Sun had used a logical and object-oriented design for creating a
GUI and handling its events. In this chapter, I will focus on creating the
window portion of the GUI by discussing containers, layout managers, and
panels. (The next chapter, “GUI Components and Event Handling,” discusses
the details of various GUI components and how to handle their events.)
AWT versus Swing
GUI, which stands for graphical user interface , refers to that portion of a pro-
gram that the user visually sees and interacts with. The GUI is an essential part
of programs that run on windows-based operating systems such as Windows,
Macintosh, and Unix. Almost every Windows program you have used is prob-
ably a GUI program: for example, Microsoft Word or Internet Explorer.
367
Search WWH ::




Custom Search