Index: gnu/java/awt/AWTUtilities.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/AWTUtilities.java,v retrieving revision 1.5 diff -u -r1.5 AWTUtilities.java --- gnu/java/awt/AWTUtilities.java 26 Jul 2005 13:53:34 -0000 1.5 +++ gnu/java/awt/AWTUtilities.java 12 Sep 2005 15:59:21 -0000 @@ -592,9 +592,12 @@ if (destination == null) destination = getRoot(source); - - convertPointToScreen(pt, source); - convertPointFromScreen(pt, destination); + + if (source.isShowing() && destination.isShowing()) + { + convertPointToScreen(pt, source); + convertPointFromScreen(pt, destination); + } return pt; } Index: javax/swing/JPopupMenu.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JPopupMenu.java,v retrieving revision 1.21 diff -u -r1.21 JPopupMenu.java --- javax/swing/JPopupMenu.java 9 Sep 2005 14:44:39 -0000 1.21 +++ javax/swing/JPopupMenu.java 12 Sep 2005 15:59:22 -0000 @@ -590,13 +590,15 @@ JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); - SwingUtilities.convertPointFromScreen(p, layeredPane); + + if (layeredPane.isShowing()) + SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; - + popup.show(p.x, p.y, size.width, size.height); } else @@ -669,11 +671,14 @@ */ public void show(Component component, int x, int y) { - setInvoker(component); - Point p = new Point(x, y); - SwingUtilities.convertPointToScreen(p, component); - setLocation(p.x, p.y); - setVisible(true); + if (component.isShowing()) + { + setInvoker(component); + Point p = new Point(x, y); + SwingUtilities.convertPointToScreen(p, component); + setLocation(p.x, p.y); + setVisible(true); + } } /** Index: javax/swing/MenuSelectionManager.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/MenuSelectionManager.java,v retrieving revision 1.11 diff -u -r1.11 MenuSelectionManager.java --- javax/swing/MenuSelectionManager.java 29 Jul 2005 19:05:01 -0000 1.11 +++ javax/swing/MenuSelectionManager.java 12 Sep 2005 15:59:22 -0000 @@ -146,7 +146,9 @@ { // Convert sourcePoint to screen coordinates. Point sourcePointOnScreen = sourcePoint; - SwingUtilities.convertPointToScreen(sourcePointOnScreen, source); + + if (source.isShowing()) + SwingUtilities.convertPointToScreen(sourcePointOnScreen, source); Point compPointOnScreen; Component resultComp = null; @@ -168,7 +170,10 @@ && sourcePointOnScreen.y < compPointOnScreen.y + size.height) { Point p = sourcePointOnScreen; - SwingUtilities.convertPointFromScreen(p, comp); + + if (comp.isShowing()) + SwingUtilities.convertPointFromScreen(p, comp); + resultComp = SwingUtilities.getDeepestComponentAt(comp, p.x, p.y); break; } Index: javax/swing/ToolTipManager.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/ToolTipManager.java,v retrieving revision 1.12 diff -u -r1.12 ToolTipManager.java --- javax/swing/ToolTipManager.java 2 Jul 2005 20:32:49 -0000 1.12 +++ javax/swing/ToolTipManager.java 12 Sep 2005 15:59:22 -0000 @@ -526,13 +526,14 @@ } else { - SwingUtilities.convertPointToScreen(p, currentComponent); - tooltipWindow = new JWindow(); - tooltipWindow.getContentPane().add(currentTip); - tooltipWindow.setFocusable(false); - tooltipWindow.pack(); - tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); - tooltipWindow.show(); + if (currentComponent.isShowing()) + SwingUtilities.convertPointToScreen(p, currentComponent); + tooltipWindow = new JWindow(); + tooltipWindow.getContentPane().add(currentTip); + tooltipWindow.setFocusable(false); + tooltipWindow.pack(); + tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); + tooltipWindow.show(); } currentTip.setVisible(true); } Index: javax/swing/plaf/basic/BasicToolBarUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicToolBarUI.java,v retrieving revision 1.11 diff -u -r1.11 BasicToolBarUI.java --- javax/swing/plaf/basic/BasicToolBarUI.java 26 Jul 2005 14:16:43 -0000 1.11 +++ javax/swing/plaf/basic/BasicToolBarUI.java 12 Sep 2005 15:59:22 -0000 @@ -1030,13 +1030,15 @@ } origin = new Point(0, 0); - SwingUtilities.convertPointToScreen(ssd, toolBar); + if (toolBar.isShowing()) + SwingUtilities.convertPointToScreen(ssd, toolBar); if (! (SwingUtilities.getAncestorOfClass(Window.class, toolBar) instanceof UIResource)) // Need to know who keeps the toolBar if it gets dragged back into it. origParent = toolBar.getParent(); - - SwingUtilities.convertPointToScreen(origin, toolBar); + + if (toolBar.isShowing()) + SwingUtilities.convertPointToScreen(origin, toolBar); isDragging = true;