|
-
Feb 24th, 2004, 03:10 PM
#1
Thread Starter
Addicted Member
GUI within a GUI [Resolved]
I've some code that starts a GUI, then upon pressing a button, a second smaller GUI opens (this smaller GUI is a variable of the main GUI). Is there any way to close the smaller GUI without closing the larger one? ie: Without using System.exit ( 0 ); ?
Thanks in advance
Last edited by MethadoneBoy; Mar 19th, 2004 at 06:51 AM.
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Feb 24th, 2004, 03:26 PM
#2
Dazed Member
I guess it depends if you want to free up resources(you are done with the GUI) or you just want to hide it for a time. For the latter you could just call setVisible(false).
-
Feb 25th, 2004, 06:13 AM
#3
To free up the resources, call dispose.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Feb 25th, 2004, 06:38 AM
#4
Thread Starter
Addicted Member
Originally posted by Dilenger4
I guess it depends if you want to free up resources(you are done with the GUI) or you just want to hide it for a time. For the latter you could just call setVisible(false).
Well, it's more like I want to close the smaller GUI altogether. Let's say the main GUI has a thread that increments an integer variable every couple of seconds. Once you press a button, the smaller GUI pops up showing this integer variable, while at the same time the main GUI is still incrementing. I'd like to be able to close the smaller GUI so that I can reload it later, when it will display the new integer value.
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Feb 25th, 2004, 12:15 PM
#5
Dazed Member
Well if you invoke setVisible(false) the gui and related resources will still reside in memory. If you invoke dispose() the resources for your GUI will be destroyed with any memory it consumes to be returned back to the OS.
-
Feb 25th, 2004, 03:26 PM
#6
Thread Starter
Addicted Member
Originally posted by CornedBee
To free up the resources, call dispose.
Originally posted by Dilenger4
If you invoke dispose() the resources for your GUI will be destroyed with any memory it consumes to be returned back to the OS.
That worked fine. Thanks
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Feb 25th, 2004, 08:30 PM
#7
Dazed Member
Anytime.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|