Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

isVisible() problem

843804Jan 27 2005 — edited Jan 27 2005
A quick summary of my problem. I have a JPanel with a button that launches another window (JFrame), and I want to check whether this second panel is visible when a button is pressed on the first panel. So I have added an isVisible() check on the button. I then perform the following tests:

1. Press the button - isVisible() returns false
2. Open the 2nd window and press the button - isVisible returns true.
3. Dismiss the 2nd frame (using either the 'x' or "close" menu item) , then press the button - isVisible() still returns true.

The 2nd window has the default close operation set to DISPOSE_ON_CLOSE. So my question is why does case 3 still return true? Note I can not replicate this in a simple example I don't think, so there must be something else going on, but don't know where to look.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2005
Added on Jan 27 2005
8 comments
266 views