谁能帮助解释为什么这不起作用?
menuItem = new JMenuItem("Document");
menuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.out.println("button clicked!");
}
});
submenu.add(menuItem);
谢谢!