0

Hi all,

I want to dispose a JFrame using a click-event. So I simply do this on Netbens.

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}

But it not work. Do you have any idea.

I just want to dispose all the visible JFrames. Actually I have only one JFrame visible. So this should work, but no luck. No any exceptions either on it.

And also I just want to dispose, not to exit the application.

Any idea?

1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by eranga262154
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.