Self-Review Exercises

22.1Fill in the blanks in each of the following statements:
  1. The__________ class is used to create a menu object.

  2. The__________ method of class JMenu places a separator bar in a menu.

  3. JSlider events are handled by the__________ method of interface _________.

  4. The GridBagConstraints instance variable ________is set to CENTER by default.

22.2State whether each of the following is true or false. If false, explain why.
  1. When the programmer creates a JFrame, a minimum of one menu must be created and added to the JFrame.

  2. The variable fill belongs to the GridBagLayout class.

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

  4. The default layout for a Box is BoxLayout.

22.3

Get Java™ How to Program, Seventh 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.