JDK-4472411 : Maximizing a client decorated frame covers system bar under windows 2000
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2001-06-20
  • Updated: 2003-04-30
  • Resolved: 2003-04-30
Related Reports
Duplicate :  
Relates :  
Description
If a client decorated frame is maximized using setExtendedState() under windows
the system menu bar is covered.  This does not happen with native windows or
system decorated frames.  Attached is a sample program to reproduce this.

Comments
WORK AROUND Rectangle bounds = getGraphicsConfiguration().getBounds(); Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(getGraphicsConfiguration()); bounds.x += insets.left; bounds.y += insets.top; bounds.width -= Math.abs(insets.left - insets.right); bounds.height -= Math.abs(insets.top - insets.bottom); setMaximizedBounds(bounds); setExtendedState(Frame.MAXIMIZED_BOTH);
11-06-2004

EVALUATION The thought, at least on the AWT side was that if a client app is maximizing an undecorated frame they would want to take over the entire screen. This explains the behavior. I suggest that Swing do the following just before maximizing the PLAF decorated frame.. Rectangle bounds = getGraphicsConfiguration().getBounds(); Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(getGraphicsConfiguration()); bounds.x += insets.left; bounds.y += insets.top; bounds.width -= Math.abs(insets.left - insets.right); bounds.height -= Math.abs(insets.top - insets.bottom); setMaximizedBounds(bounds); setExtendedState(Frame.MAXIMIZED_BOTH); This will make the frame take up only the available desktop sans the toolbar. richard.ray@eng 2001-06-25 Talked with Mike about this. Your explanation sounds good. I'll fix the swing side of things. joutwate@eng 2001-06-27 After more thought we should leave this up to the window manager and if the user wants they can change this themselves. joutwate@eng 2001-07-11
27-06-2001