< prev index next >

src/java.desktop/share/classes/java/awt/Component.java

Print this page

        

@@ -2032,18 +2032,18 @@
     /*
      * a package private version of getLocationOnScreen
      * used by GlobalCursormanager to update cursor
      */
     final Point getLocationOnScreen_NoTreeLock() {
-
+        ComponentPeer peer = this.peer;
         if (peer != null && isShowing()) {
             if (peer instanceof LightweightPeer) {
                 // lightweight component location needs to be translated
                 // relative to a native component.
                 Container host = getNativeContainer();
                 Point pt = host.peer.getLocationOnScreen();
-                for(Component c = this; c != host; c = c.getParent()) {
+                for(Component c = this; c != host; c = c.getContainer()) {
                     pt.x += c.x;
                     pt.y += c.y;
                 }
                 return pt;
             } else {
< prev index next >