Exercises
25.4
(Fill-in-the-Blanks) Fill in the blanks in each of the following statements:
A
JMenuItem
that is aJMenu
is called a(n).Method attaches a
JMenuBar
to aJFrame
.Container class has a default
BoxLayout
.A(n) manages a set of child windows declared with class
JInternalFrame
.
25.5
(True or False) State whether each of the following is true or false. If false, explain why.
Menus require a
JMenuBar
object so they can be attached to aJFrame
.BoxLayout
is the default layout manager for aJFrame
.JApplet
s can contain menus.
25.6
(Find the Code Errors) Find the error(s) in each of the following. Explain how to correct the error(s).
x.add( new JMenuItem( “Submenu Color” ) ); // create submenu
Get Java How to Program (early objects), 9/e 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.