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 e)
{
doSomethingElse(e) ;
}
}
mi.addActionListener(new MyMenuListener() ) ;
return mi;
}
A) 1
B) 2
C) 3
D) 4
Correct Answer:
Verified
Q44: If the method makeMenuItem is called four
Q45: Which elements of creating a graphical user
Q46: You can add a(n) _ to a
Q47: Which of the following generate action events?
A)Buttons
B)Menu
Q48: What is the most time-effective way to
Q50: Which component can be added to a
Q51: Which of the following would be an
Q52: What can be determined about obj from
Q53: Based on the statement below, which of
Q54: Which of the following defines the job
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents