Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: Closing an JInternalFrame

  1. #1
    joroscof is offline Member
    Join Date
    Aug 2012
    Posts
    4
    Rep Power
    0

    Default Closing an JInternalFrame

    Hi,

    Is there any other way to close a JInternalFrame than dispose() because i want to keep the information that it contains and with dispose it deletes everything.

    Thanks

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Closing an JInternalFrame

    I'm not sure that dispose() deletes everything, but you certainly can use setVisible(false).

    Edit: per the JinternalFrame API, dispose() just "Makes this internal frame invisible, unselected, and closed." There is no mention of deleting or removing information, and that confirms my previous experience with using dispose().
    Last edited by Fubarable; 08-25-2012 at 05:48 PM.

  3. #3
    joroscof is offline Member
    Join Date
    Aug 2012
    Posts
    4
    Rep Power
    0

    Default Re: Closing an JInternalFrame

    Yes i tried that but if i do set Visible(false) or true it doesnt add it to the DesktopPane that i have. I use this code to show the JInternalFrame

    Java Code:
    regConteo.setVisible(true);
    		Portada tmp = (Portada) Main.getInstance().currWindow;
    		tmp.getDesktop().add(regConteo);
    		tmp.getDesktop().moveToFront(regConteo);
    		try {
    			regConteo.setSelected(true);
    		} catch (PropertyVetoException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    and for closing i use

    Java Code:
    tmp.getDesktop().remove(this);
    			tmp.getDesktop().moveToFront(tmp.regRecepcion);
    			try {
    				tmp.regRecepcion.setSelected(true);
    			} catch (PropertyVetoException e) {
    				e.printStackTrace();
    			}
    Thanks for your help.

  4. #4
    joroscof is offline Member
    Join Date
    Aug 2012
    Posts
    4
    Rep Power
    0

    Default Re: Closing an JInternalFrame

    Hm i have a JTable in that JInternalFrame and when i open it again it doesnt show any of the rows i added i though it was because of that... Ok ill do a bit more of research. Thanks

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Closing an JInternalFrame

    Moved from New to Java

    db
    joroscof likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 1
    Last Post: 09-27-2011, 04:19 PM
  2. Replies: 4
    Last Post: 09-27-2011, 09:20 AM
  3. Replies: 0
    Last Post: 08-09-2011, 06:07 PM
  4. JInternalFrame Help
    By collin389 in forum New To Java
    Replies: 2
    Last Post: 03-16-2010, 12:23 AM
  5. JInternalFrame Help
    By collin389 in forum AWT / Swing
    Replies: 1
    Last Post: 03-15-2010, 09:24 PM

Posting Permissions

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