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

getLocationOnScreen returns incorrect values

XMLWordPrintable

    • x86
    • windows_nt



      Name: dmR10075 Date: 12/05/2000

      ###@###.###

      Bug can be reproduced at least from Merlin b35 on Win32.
      It can only be reproduced with the task bar on the left side of the desktop.

      Steps to reproduce:
      1. Run the test case.
      2. The frame will appear at (100, 100) (it can be checked by Robot or some Screen capture tool)
      3. In console you will see the printout of getLocationOnScreen, the output in console will
      differ from (100, 100)

      --------------Test.java-----------------------
      import java.awt.*;

      public class Test extends Frame {
          public static void main(String[] args) {
              new Test();
          }
          public Test() {
              super("Frame");
              setBounds(100, 100, 100, 100);
              setVisible(true);
              System.out.println("Frame " + this);
              System.out.println("Frame location " + getLocationOnScreen());
          }
      }
      ------------------------------------------

      ======================================================================

            rraysunw Richard Ray (Inactive)
            domsunw Dom Dom (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: