0

I've made a Menu bar and when i click on Help>>about a popup window jumps. i also put on the popup window a button and i'm wondering what's the command i should use to close the popup window in the button action listener but not abort the program. (i tried before to use (System.exit(0)) but it's abort the program.

here's a picture of the button i'm talking about

2
  • Don't post a picture of your IDE, that doesn't help. In the future post a proper SSCCE that demonstrates the problem. Commented Dec 1, 2015 at 21:35
  • In the actionPerformed(ActionEvent e) method, you can use window.dispose(); or setVisible(false); window.dispose(); Commented Dec 1, 2015 at 22:11

1 Answer 1

6

i'm wondering what's the command i should use to close the popup window

You would use:

window.dispose();

Or better yet just use a JOptionPane to display the "About" dialog. The JOptionPane will build the dialog and buttons for you.

Check out the section from the Swing tutorial on How to Make Dialogs for more information and examples.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.