How do you close out an application when using a menubar?

The native 'X' button does show and I am able to close by clicking that without a problem. Here's the situation. My .jar program is executed by another application and my form/JFrame shows up as expected. When its time to exit, I click the 'X' and my form/program ends and the application running my program also exits (frees up memory). When I use my menubar to excute an exit, the form disappears due to my call to .Dispose() (there isn't a .close/.exit). It appears my program has ended, but the .jar is still running (taking up memory) by way of the application running the .jar.

So I ask, how I can I throw the System.Exit(0) when calling my actionEvent on the menubar as it works when the 'X' button is excuted??


main in main class
Code:
myFrame.addWindowListener(new WindowAdapter()
			{ public void windowClosing (WindowEvent event)
				{ System.exit(0); }
			}		
		);
		myFrame.setDefaultCloseOperation(myFrame.EXIT_ON_CLOSE);	
		myFrame.setVisible(true);
		
		JMenuBar mBar = new JMenuBar();
		JMenu mnuFile = new JMenu("File");
		JMenuItem mnuFileExit = new JMenuItem("Exit");
		mBar.add(mnuFile);
			mnuFile.add(mnuFileNew);
			mnuFile.add(mnuFileExit);
			mnuFileExit.addActionListener(new FileExit_Click());
FileExit_Click class implementing ActionListener
Code:
public void actionPerformed(ActionEvent arg0)
{
     /*placing addWindowListener here also doesn't work*/
     myFrame.addWindowListener(new WindowAdapter()
          {
               public void windowClosing (WindowEvent event) { System.exit(0); } 
          } );


     myFrame.dispose();
}