Self-Review Exercises

22.1 Fill in the blanks in each of the following statements:

a) The _________ class is used to create a menu object.

b) The _________ method of class JMenu places a separator bar in a menu.

c) JSlider events are handled by the _________ method of interface _________.

d) The GridBagConstraints instance variable _________ is set to CENTER by default.

22.2 State whether each of the following is true or false. If false, explain why.

a) When the programmer creates a JFrame, a minimum of one menu must be created and added to the JFrame.

b) The variable fill belongs to the GridBagLayout class.

c) Drawing on a GUI component is performed with respect to the (0, 0) upper-left corner coordinate of the component.

d) The default layout ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.