Results 1 to 7 of 7

Thread: GUI within a GUI [Resolved]

  1. #1

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180

    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...."

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    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).

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  4. #4

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180
    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...."

  5. #5
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    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.

  6. #6

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180
    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...."

  7. #7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width