-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
generic
-
generic
From inspecting the code, it looks as if there are a number of problems with the way Window.setLocationRelativeTo() centers a Window (i.e. when Component is null):
* it should retrieve the screen bounds using Window.getGraphicsConfiguration().getBounds(), which will return the bounds of the screen the Window is on, rather than the primary screen
(and)
* it should account for the screen insets using the new 1.4 Toolkit.getScreenInsets() to account for the screen inets
(or alternatively)
* it should use the new 1.4 GraphicsEnvironment.getCenterPoint() and getMaximumWindowBounds() methods, which should take care of most of the calculations.
* it should retrieve the screen bounds using Window.getGraphicsConfiguration().getBounds(), which will return the bounds of the screen the Window is on, rather than the primary screen
(and)
* it should account for the screen insets using the new 1.4 Toolkit.getScreenInsets() to account for the screen inets
(or alternatively)
* it should use the new 1.4 GraphicsEnvironment.getCenterPoint() and getMaximumWindowBounds() methods, which should take care of most of the calculations.
- duplicates
-
JDK-6177452 setLocationRelativeTo() places the window incorrectly on multi-mon-xinerama when comp is invisible
-
- Closed
-