If the method makeMenuItem is called four times, how many MyMenuListener objects will be created?
Public JMenuItem makeMenuItem(String menuLabel)
{
JMenuItem mi = new JMenuItem(menuLabel) ;
Class MyMenuListener implements ActionListener
{
Public void actionPerformed(ActionEvent
A) 1
B) 2
C) 3
D) 4
E) {
DoSomething() ;
}
}
Mi) addActionListener(new MyMenuListener() ) ;
Return mi;
}
Correct Answer:
Verified
Q46: Which component can generate action events?
I JMenuBar
II
Q51: Examine the code below. What type of
Q53: If the makeMenuItem method is called four
Q56: For a new programmer using the Swing
Q59: Which component can be added to a
Q61: Consider the following code snippet:
Class MouseClickedListener implements
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
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