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
A) 1
B) 2
C) 3
D) 4
E) {
DoSomethingElse(e) ;
}
}
mi.addActionListener(new MyMenuListener() ) ;
Return mi;
}
Correct Answer:
Verified
Q15: What is the best first step in
Q46: Which component can generate action events?
I JMenuBar
II
Q47: If one ChangeListener is listening for three
Q49: Suppose a JPanel with a BorderLayout manager
Q50: What is the best way to discover
Q52: Suppose a JPanel with a BorderLayout manager
Q53: If a JPanel with a BorderLayout manager
Q55: Which code will create a JSlider with
Q56: For a new programmer using the Swing
Q66: What type of event does the JSlider
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