Exercises
-
35.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
.
-
35.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.
-
35.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”)); ...
Get Java How to Program, Early Objects, 11th 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.