void (boolean update) { if (myView != null) { myOwner.removeHierarchyListener(myListener); SwingUtilities.getWindowAncestor(myOwner).removeWindowFocusListener(myWindowFocusAdapter); boolean visible = myView.isVisible(); myView.setVisible(false); Container container = myContent.getParent(); if (container != null) { container.remove(myContent); } if (myView instanceof Window) { myViewBounds = myView.getBounds(); ((Window)myView).dispose(); } else { Container parent = myView.getParent(); if (parent == null) { myViewBounds = new Rectangle(myContent.getPreferredSize()); } else { myViewBounds = new Rectangle(myView.getBounds()); parent.remove(myView); Point point = new Point(myViewBounds.x, myViewBounds.y); SwingUtilities.convertPointToScreen(point, parent); myViewBounds.x = point.x; myViewBounds.y = point.y; } } myView = null; if (update && visible) { setVisible(true); } } }