/** * closes the internal frame and removes any associated button and menu components * * @param f the internal frame being closed */ public void closeFrame(JInternalFrame f) { super.closeFrame(f); // possible to retrieve the associated buttons right here via // f.getAssociatedButton(), and then with a call to getParent() the item // can be directly removed from its parent container, but I find the // below message propogation to DesktopPane a cleaner implementation... desktopPane.removeAssociatedComponents((BaseInternalFrame) f); desktopPane.resizeDesktop(); }