close Jframe from code

P

palmis

How can I close JFrame from code?
In my application If I select one JRadioBox, I want to close another
JFrame as if I click on the high-rigth button X.

How can I do?
Thanks
palmis
 
O

Oliver Wong

palmis said:
How can I close JFrame from code?
In my application If I select one JRadioBox, I want to close another
JFrame as if I click on the high-rigth button X.

How can I do?

You can call setVisible(false) on it, or you can call dispose() on it.
From the user's perspective, the window just disappears. But they have
different semantics from the programmer's side, so read the Javadocs for
both methods and see which one you want to use.

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,269
Messages
2,571,099
Members
48,773
Latest member
Kaybee

Latest Threads

Top