I want make an onMouseClick
menu item to close the application.
I have tried to add System.exit(0);
but its not work.
This is my piece of code:
JMenuItem mntmExit = new JMenuItem("Exit");
mntmExit.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
}
});
mnFile.add(mntmExit);