• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Internal window setMaximum problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
 
reply
    Bookmark Topic Watch Topic
  • New Topic