import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
...
JMenuBar mb = new JMenuBar();
frame.setJMenuBar( mb );
JMenu help = new JMenu( "Help", false);
help.getAccessibleContext().setAccessibleDescription( "Help" );
mb.add( help );
JMenuItem about = new JMenuItem( "About" );
about.setActionCommand( "About" );
help.add( about );
about.addActionListener
(
new ActionListener()
{
/**
* Handle Menu Selection Request
*
* @param e event giving details of selection
*/
public void actionPerformed( ActionEvent e )
{
...
}
}
);