File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Internal window setMaximum problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Internal window setMaximum problem" Watch "Internal window setMaximum problem" New topic

Internal window setMaximum problem

Steve Chen

Joined: Mar 26, 2004
Posts: 3
I have one internal frame created in maximized state. A 2nd internal frame is created in normal state. When I click on 2nd frame, the first frame is changed to normal state.

Anyone know what might cause this behavior? I have spent hours trying to debug this problem, any pointer will be appreciated.

I do not have any other code that setMximum except during initalization. Somehow, _internalWindow has it maximum state changed.
Steve Chen

Joined: Mar 26, 2004
Posts: 3
I realize this happens when I change UI manager:


In windows XP, this will cause WindowsDesktopManager to be used. In it's activateFrame(JInternalFrame f) method, when a new frame is activated, it will restore the other frame. Anyone know how to get around this problem?

public void activateFrame(JInternalFrame f) {
JInternalFrame currentFrame = currentFrameRef != null ?
currentFrameRef.get() : null;
try {
if (currentFrame != null && f != currentFrame) {
// If the current frame is maximized, transfer that
// attribute to the frame being activated.
if (currentFrame.isMaximum() &&
(f.getClientProperty("JInternalFrame.frameType") !=
"optionDialog") ) {
//Special case. If key binding was used to select next
//frame instead of minimizing the icon via the minimize
if (!currentFrame.isIcon()) {
if (f.isMaximizable()) {
if (!f.isMaximum()) {
} else if (f.isMaximum() && f.isIcon()) {
} else {
Steve Chen

Joined: Mar 26, 2004
Posts: 3
i solved the problem by setting following property, maybe not a proper fix, but at least, i got behavior i wanted.

for popup windows in desktop pane, i added following code:

internalwindow.putClientProperty("JInternalFrame.frameType", "optionDialog");
I agree. Here's the link:
subject: Internal window setMaximum problem
It's not a secret anymore!