The more the merrier.
this chapter we give you some additional information about Swing, so that you
can create more profession looking GUIs. Section 14.1 introduces menus, which we
have not discussed before. However, as you will see, much of what you learned about
buttons will carry over to menus. So, Swing menus will not look completely new to
you. The material in Sections 14.2 through 14.1 cover some enhancements of basic
things you already are doing with Swing. In particular, Section 14.1 covers inner
classes. Section 14.2 covers look and feel in Swing, a topic that is something of a hall-
mark for Swing.
Along the way you will learn about these Swing (or Swing-related) classes:
, and others.
Learn to add menus, icons, borders, and scroll bars to your GUIs.
manager and the
Find out how to change the look and feel of a Swing GUI.
Understand some uses and advantages of inner classes.
Learn about the
Find out how to create GUIs with components that change from visible
to invisible and vice versa.
Before covering this chapter, you need to have covered Chapter 12 which introduces
you to Swing. You do not need to have covered Chapter 13 (Applets) before cover-
ing this chapter. For the subsection entitled
Changing the Look and Feel
14.2, you need to have read the beginning of Chapter 8 on exception handling.
The boxed subsection
Adding Icons to Menu Items (Alternative Ordering)
Section 14.1 naturally requires that you ±rst cover the subsection
Menus, and Menu Items
in Section 14.2. Aside from that one clearly marked boxed
subsection, the sections 14.2 (menus), 14.2 (icons, look and feel, plus other good-