I am using the following code, I tried to implement an Exit button, but it does nothing when it is pressed.
JMenuBar menuBar = new JMenuBar();
setJMenuBar( menuBar );
JMenuItem menuClose = new JMenu( "Exit" );
menuClose.setToolTipText("Exit application");
menuClose.addActionListener( new ActionListener(){
public void actionPerformed( ActionEvent e ){
System.exit(0);
}
});
menuBar.add( menuClose );
Ideas?