Meaningless Drivel is fun!
The moose likes Swing / AWT / SWT and the fly likes JInternalFrame double click Not closing theJInternalFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternalFrame double click Not closing theJInternalFrame" Watch "JInternalFrame double click Not closing theJInternalFrame" New topic

JInternalFrame double click Not closing theJInternalFrame

ghazanfar khan
Ranch Hand

Joined: Apr 18, 2005
Posts: 81
Hello Everyone,
I have an applicaiton, in which Main Frame JFrame contain some JInternalFrame which is added into JDesktopPane. My question is that if i click on Internal Frame icon, so it is not closing the Frame but it maximize the size of the Frame. Can anyone please help me, might this is a very baisc question but i am stuck in that.

thanks in advance.
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Without sample code one can't be sure but study the JInternalFrame constructor you are using:

Use a constructor that have the maximizable parameter, and of course you should pass true to it. Or call setMaximizable. If that doesn't work, try a different look and feel -- according to the documentation, not all look and feels support maximizing.

There is no emoticon for what I am feeling!
ghazanfar khan
Ranch Hand

Joined: Apr 18, 2005
Posts: 81
Thanks for your reply, I am using the following constructor
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)

But the thing is that i want for example when you double click on any of your window's icon(Top Left Corner) so it close down that window. thay functionality i am looking that if someone double click on icon of my JInternalFrame it suppose to close that window.

thanks for your reply.
[ March 01, 2006: Message edited by: ghazanfar khan ]
Vasu Reddy
Ranch Hand

Joined: Sep 13, 2005
Posts: 32
Hi Khan,

I am also trying for it. If you find the solution, please share, it would be useful.

Alex Matute

Joined: Jun 28, 2005
Posts: 14
That makes 3 of us... please let me know if anybody finds a solution for this!!



-------------------<br /> <br />SCJD
Kirill Grouchnikov

Joined: Aug 03, 2006
Posts: 10
Substance LAF [1] supports this. Try version 3.0RC or 3.1dev. Double click on the title pane maximizes the internal frame, while double click on the icon closes the internal frame.

dave lock

Joined: Sep 06, 2006
Posts: 1
You need to extend BasicInternalFrameTitlePane and override the following method.

This adds an action listener to the system menu and calls the default close action on the frame.

You will then need to use this TitlePane by writing your own JInternalFrameUI like so...

I don't know how you set up your L&F but you can either assign the UI directly to all JInternalFrames via the UIManager or assign it explicitly to each JInternalFrame like so...
JInternalFrame jif = new JInternalFrame();

Hope that helps.
I agree. Here's the link:
subject: JInternalFrame double click Not closing theJInternalFrame
jQuery in Action, 3rd edition