File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Non-maximizable JInternalFrame being maximised in MDI Application

 
Terry Ong
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a piece of sample code.
Sorry that its a bit long.


 
Terry Ong
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Problem:

The fault lies with Java's implementation of DesktopManager.




The culprit:

 
Terry Ong
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solution 1: Use DefaultDesktopManager

desktop.setDesktopManager(new DefaultDesktopManager());


Solution 2: Hackishly substitute UI

 
Terry Ong
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solution 3


[ December 19, 2006: Message edited by: Terry Ong ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic