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

getLocationOnScreen() returns incorrect values when the frame is in minimized state

XMLWordPrintable

    • Cause Known
    • generic, x86
    • generic, windows_xp

      I am calling getLocationOnScreen() with respect to a frame and the frame is in minimized state. On Solaris / Linux, it returns the location of the frame where it was before the iconification (or where it would go when it is restored). On Win32, it is returning an invalid location such as -32000, -32000. I feel both the behaviors are incorrect. Ideally it should throw IllegalComponentStateException when the frame is in minimized state. Or at least, the expected outcome must be documented clearly in getLocationOnScreen(). Currently the document does not specify anything for this case.

      This is reproducible right from 1.4 on all platforms.

      I have attached a sample test. Execute the sample test. You would see a frame with a button. Click on the button. Frame will be minimized and location will be printed on the console. If you notice the above behaviors, the bug is reproduced.
      ###@###.### 11/2/04 15:00 GMT

            yan Yuri Nesterenko
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: