JDK-6820908 : roblem with setMaximizedBounds on 2 screens with different size.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-03-23
  • Updated: 2011-01-19
  • Resolved: 2010-10-05
Related Reports
Duplicate :  
Description
Problem: 
  - setExtendedState ignores the screen insets by default(i.e. the windows task bar)
    -> Workaround would be to use setMaximizedBounds
  - setMaximizedBounds works well on single screen or dual screen, if both screens
    have the same size
  - if the secondary screen is wider than the primary, setMaximizedBounds and
    setExtendedState( Frame.MAXIMIZED_BOTH ) on the secondary screen result in a
    frame which is wider than the screen size allows

Steps to reproduce the error:
  - two screens, the wider screen has the same height like the first one and is 
    to the right of the first one
  - start the program, move the frame to the secondary screen, click on the button

Analysis:
  - if we set the maximized bounds on the secondary screen to the width of
    of the primary screen, the frame gets the correct size( even though the
    size we've set was to small!)
  - any wider size ( the real width of the secondary for instance) result in
    a too wide maximized frame
  - any smaller size than the width of the primary screen will maximize to
    exactly this width in pixels on the secondary.