Re: Netbeans GUI EXIT button?

If you want to close the window containing the exit button, just do that. setVisible() can be used to "close" windows.

You don't say what sort of component is involved (JFrame, JDialog etc) but the How to Make Frames page in Oracle's Tutorial will be useful. It contains a section on how to close them (including how to respond to a user closing a frame).

[Edit] I've just realised this is in the SWT/JFace forum... The point that you shouldn't use exit() remains, but you should look at the API docs of the component you use to represent a window to find a method that allows it to be hidden or deleted entirely.

shows clearly that this is a Swing/Netbeans question, and that the code has been generated by the visual designer; also that it has been corrupted in the course of copy/pasting.

I'm moving the thread to AWT/Swing. To blackz, I suggest you dump the visual designer. It's an advanced tool, only worth learning if you plan to make a career of GUI design. Learn to hand-code your GUIs, with guidance from the tutorial and the API.

db

If you're forever cleaning cobwebs, it's time to get rid of the spiders.