Answers to Self-Review Exercises

12.1

a) mouseMoved.

b) uneditable (read-only).

c) layout manager.

d) Container.

e) graphical user interface.

f) setLayout.

g) mousePressed, mouseReleased.

h) JOptionPane.

i) showInputDialog, JOptionPane.

j) showMessageDialog, JOptionPane.

k) JTextComponent.

12.2

a) True.

b) False. Method mouseEntered is called.

c) False. A JPanel can be added to another JPanel, because JPanel is an indirect subclass of Component. So, a JPanel is a Component. Any Component can be added to a Container.

d) False. Only the last button added will be displayed. Remember that only one component should be added to each region in a BorderLayout.

e) True. [Note: Panels containing multiple components can be added to each region.]

f) False. ...

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.