Multiple Choice
If the makeMenuItem method is called four times, at most how many different actions can be performed by these four newly created MenuItem objects when the doSomethingElse method is called?
Public JMenuItem makeMenuItem(String menuLabel)
{
JMenuItem mi = new JMenuItem(menuLabel) ;
Class MyMenuListener implements ActionListener
{
Public void actionPerformed(ActionEvent mi.addActionListener(new MyMenuListener() ) ;
Return mi;
}
}
A) 1
B) 2
C) 3
D) 4
E) {
DoSomethingElse(e) ;
}
Correct Answer:

Verified
Correct Answer:
Verified
Q2: What type of event does the JSlider
Q6: Suppose a JPanel with a BorderLayout manager
Q10: Which of the following adds a border
Q11: Insert the missing code in the following
Q19: What is the default layout manager of
Q35: How do you add two buttons to
Q40: Which layout manager places objects left-to-right, and
Q51: What does the MouseAdapter class provide?<br>A) The
Q69: The statement that would add smallButton to
Q70: If you want to have a tabular