What is the container for top level menu items Select one a menu ba.docx
1. What is the container for top level menu items? Select one: a
menu bar b. menu item c. menu GU u, d. top level menus don't
use containers Which component can be added to a menu? II
JMenu III MenuItem Select one a. I b. I and II c. Il and iIll d. I.
Ill and i
Solution
1.What is the container for top level menu items?
Ans)a. Menu bar
menu bar is a top-level container. The menu bar is by
convention positioned within the top-level container, but
outside the content pane and menu bar contains menus.
2.Which component can be added to a menu?
Ans) c.JMenu and JMenuItem
Menu having submenu and menu items when we create the
container for top level menu and menu Items.
3.SKIP QUESTION!______________ are round and have a
black dot when selected?
Ans) c. radio buttons
Radio buttons are round and have a black dot when selected.
4. which of the following statements about inheritance is NOT
true?
Ans) d. Instance fields can be overridden
2. The above statement is wrong about inheritance because of
Instance fields cannot be overridden.
5. To associate an event listener with a JButton component, you
must use the ____method of the JButton class
Ans) b. addActionListener
JButton have addActionListener method when Action or event
performed. To associate an event listener with a JButton
component, you must use the addActionListener method of the
JButton class
6. Which layout manager places objects left-to-right, row by
row into a fixed set of rows….
Ans) d. GridLayout
The class GridLayout arranges components in a matrix grid. In
GridLayout components added from left to right and row by
row.
7. The Date class is found in which package?
Ans) a. java.util package
Date class is in the util package in java. If you want use this
class, first import that class from util package. import
java.util.Date;