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

Internal window setMaximum problem

 
Steve Chen
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
_internalWindow.setMaximum(true);
 
Steve Chen
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I realize this happens when I change UI manager:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

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 {
super.activateFrame(f);
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
//icon.
if (!currentFrame.isIcon()) {
currentFrame.setMaximum(false);
if (f.isMaximizable()) {
if (!f.isMaximum()) {
f.setMaximum(true);
} else if (f.isMaximum() && f.isIcon()) {
f.setIcon(false);
} else {
f.setMaximum(false);
}
}
}
}
 
Steve Chen
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic