• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

JInternalFrame double click Not closing theJInternalFrame

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes 3 of us... please let me know if anybody finds a solution for this!!

Thnx

--Alex
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic