Index: javax/swing/ToolTipManager.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/ToolTipManager.java,v retrieving revision 1.26 diff -u -r1.26 ToolTipManager.java --- javax/swing/ToolTipManager.java 27 Sep 2005 17:17:48 -0000 1.26 +++ javax/swing/ToolTipManager.java 28 Sep 2005 20:06:40 -0000 @@ -475,13 +475,14 @@ if (isLightWeightPopupEnabled()) { - JLayeredPane pane = ((JRootPane) SwingUtilities. - getAncestorOfClass(JRootPane.class, currentComponent)). - getLayeredPane(); - - // This should never happen, but just in case. + JLayeredPane pane = null; + JRootPane r = ((JRootPane) SwingUtilities. + getAncestorOfClass(JRootPane.class, currentComponent)); + if (r != null) + pane = r.getLayeredPane(); if (pane == null) return; + if (containerPanel != null) hideTip(); @@ -544,7 +545,7 @@ p.x = 0; if (p.y + d.height < c.getHeight()) p.y += d.height; - else if (p.y + d.height > c.getHeight()) + if (p.y + d.height > c.getHeight()) p.y -= d.height*2; return p;