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
Q51: Examine the code below. What type of
Q55: Which code will create a JSlider with
Q56: If the method makeMenuItem is called four
Q59: Which component can be added to a
Q65: The _ class in the javax.swing package
Q66: What type of event does the JSlider
Q66: The Timer class is found in the
Q68: The ChangeEvent class defines no methods.What makes
Q75: The _ interface toolkit has a large
Q81: When you use a timer, you need
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