Java Reference
In-Depth Information
GExercise R18.6. What happens when you try to add a button to another
button? Try it out and explain.
GExercise R18.7. The
ColorViewerFrame
uses a grid layout manager.
Explain a drawback of the grid that is apparent from
Figure 13
. What
could you do to overcome this drawback?
GExercise R18.8. What is the difference between the grid layout and the
grid bag layout?
GExercise R18.9. Can you add icons to check boxes, radio buttons, and
combo boxes? Browse the Java documentation to find out. Then write
a small test program to verify your findings.
GExercise R18.10. What is the difference between radio buttons and check
boxes?
GExercise R18.11. Why do you need a button group for radio buttons but
not for check boxes?
GExercise R18.12. What is the difference between a menu bar, a menu, and
a menu item?
GExercise R18.13. When browsing through the Java documentation for
more information about sliders, we ignored the
JSlider
default
constructor. Why? Would it have worked in our sample program?
GExercise R18.14. How do you construct a vertical slider? Consult the
Swing documentation for an answer.
GExercise R18.15. Why doesn't a
JComboBox
send out change events?
GExercise R18.16. What component would you use to show a set of
choices, just as in a combo box, but so that several items are visible at
the same time? Run the Swing demo app or look at a book with Swing
example programs to find the answer.
GExercise R18.17. How many Swing user interface components are
there? Look at the Java documentation to get an approximate answer.
816