Multiple Choice
When method makeMenuItem is called, how many objects are being created?
public JMenuItem makeMenuItem(final String menuLabel)
{
JMenuItem mi = new JMenuItem(menuLabel) ;
class MyMenuListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
doSomethingElse() ;
System.out.println(menuLabel) ;
}
}
mi.addActionListener(new MyMenuListener() ) ;
return mi;
}
A) 1
B) 2
C) 3
D) 4
Correct Answer:

Verified
Correct Answer:
Verified
Q13: If the makeMenuItem method is called four
Q14: What is the most time-effective way to
Q15: If a JPanel with a BorderLayout manager
Q16: Which layout manager allows you to add
Q17: What is the default layout manager of
Q19: What is the default layout manager of
Q20: Which of the following GUI objects generate(s)
Q21: The event that is generated by a
Q22: What is the best first step in
Q23: Which layout manager uses a grid so