Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4487771

Window.setLocationRelativeTo() doesn't center Windows correctly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                art Artem Ananiev
                Reporter:
                bchristi Brent Christian
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: