Problems with exiting application
Hello,
I have been creating a GUI and there is an exit JButton that can be clicked and when it is clicked the screen disappears and I thought that the application had exited, but after running it a few times I noticed that my RAM had gone up to more than usual for what I have running on my system. So I opened up my task manager and noticed that there were many instances of javaw.exe running. I know one of them is eclipse and I guess that the others are from where I repeatedly test my application and it isn't closing like I thought it was when I click the exit JButton. If I use the windows close button I don't have the same problem, it only happens when I use the JButton to close. I guess that just by using setVisible(false); to set the visibility of the window to false is not enough and I need to find another command to actually exit rather than making it invisible. I'm sure one of you intelligent folk will see at a glance what iswrong. I'm still new to Java so I haven't got a clue what I should use instead.
Here is the code for the handler of the exit JButton.
Code:
exit.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
setVisible(false);
}
}
);