Two Laptop Bag*
The moose likes Swing / AWT / SWT and the fly likes Non-maximizable JInternalFrame being maximised in MDI Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Non-maximizable JInternalFrame being maximised in MDI Application" Watch "Non-maximizable JInternalFrame being maximised in MDI Application" New topic
Author

Non-maximizable JInternalFrame being maximised in MDI Application

Terry Ong
Ranch Hand

Joined: Apr 07, 2006
Posts: 50
Dear all,

I have a JDesktop that is being populated with JInternalFrames where some of them are Palettes(toolbox).

When I maximise one of the JInternalFrames(non-toolbox) and later try to set the selected frame to a toolbox frame, that tool box gets maximised. And since my toolbox is non-iconifiable, I could only switch back to the other JInternalFrame by closing that toolbox.

This occurs only in Windows look and feel...
In Metal & Motif look and feel, the behaviour is what is expected.
ie. toolbox just shows without changing its size.

Also, note that the behaviour is okay when the containing JFrame is not maximised.

I'm running on jdk 1.4.2. (requirement).
I was wondering if anyone has had the following experience working with MDI applications.

Thanks in advance for any help.
Terry Ong
Ranch Hand

Joined: Apr 07, 2006
Posts: 50
Here's a piece of sample code.
Sorry that its a bit long.


Terry Ong
Ranch Hand

Joined: Apr 07, 2006
Posts: 50
Finally managed to find out the source of the problem.
Don't know whether should i be happy or sad.
Its like i solving it alone...

Anyway, for anyone else whoose interested.
Read on the next posts. (broken so that its easier to read)
Terry Ong
Ranch Hand

Joined: Apr 07, 2006
Posts: 50
The Problem:

The fault lies with Java's implementation of DesktopManager.




The culprit:

Terry Ong
Ranch Hand

Joined: Apr 07, 2006
Posts: 50
Solution 1: Use DefaultDesktopManager

desktop.setDesktopManager(new DefaultDesktopManager());


Solution 2: Hackishly substitute UI

Terry Ong
Ranch Hand

Joined: Apr 07, 2006
Posts: 50
Both have their advantages and disadvantages.
Pick your poison


Man, spent the whole day searching the web just for this...
must be inputing the wrong keywords...
Terry Ong
Ranch Hand

Joined: Apr 07, 2006
Posts: 50
Solution 3


[ December 19, 2006: Message edited by: Terry Ong ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Non-maximizable JInternalFrame being maximised in MDI Application