Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JInternalFrame double click Not closing theJInternalFrame

 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without sample code one can't be sure but study the JInternalFrame constructor you are using:

http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JInternalFrame.html

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.
 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Khan,

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

Thanks,
 
Alex Matute
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That makes 3 of us... please let me know if anybody finds a solution for this!!

Thnx

--Alex
 
Kirill Grouchnikov
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

[1] https://substance.dev.java.net
 
dave lock
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
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();
jif.setUI(MyInternalFrameUI.createUI(jif));

Hope that helps.
locky
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic