The Artima Developer Community
Sponsored Link

Java Answers Forum
enable disable JFrame

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
mike

Posts: 4
Nickname: mikez
Registered: Jul, 2003

enable disable JFrame Posted: Jul 19, 2003 9:24 AM
Reply to this message Reply
Advertisement
So heres my problem. I have a JFrame1 displayed on the screen. When I click on a button on JFrame1, another JFrame2 pops up. The instance of JFrame2 is held in JFrame1's class. JFrame2 uses getParent() in order to find JFrame1, it then calls setEnabled(false) to disable the main JFrame1. My problem is figuring out how to re-enable JFrame1 when it is already disabled, and JFrame2 gets closed. I've tried many ways including static methods in JFrame1, and trying to re-enable JFrame1 in the event handling method of JFrame2. getParent() doesnt seem to want to work in JFrame2 when JFrame1 is disabled, maybe because its a seperated JFrame2 looking for a JFrame1 when JFrame1 holds the instance of JFrame2 but JFrame2 was never add() to JFrame1, I dont know.

Basically, I'm wondering how I can re-enable a main JFrame ,after a second JFrame that has popped up, is closed. Thanks.

Topic: compile error Previous Topic   Next Topic Topic: Reading values from an array

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use