0

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);
Ang3lStyl3X
  • 63
  • 1
  • 11

0 Answers0