/** * Tries to determine the frame the container is part of. * * @return the parent frame if one exists or null if not */ public Frame getParentFrame() { return GUIHelper.getParentFrame(this); }
/** * Tries to determine the component this panel is part of in this order: * 1. dialog, 2. child, 3. frame. * * @param comp the component to get the parent component for, must * be a container actually * @return the parent component if one exists or null if not * @see #getParentDialog(Container) * @see #getParentFrame(Container) */ public static Component getParentComponent(Component comp) { Component result; Container cont; if (comp == null) return null; if (comp instanceof Container) cont = (Container) comp; else return null; result = getParentDialog(cont); if (result == null) result = getParentFrame(cont); return result; }
dialog.setVisible(false); else if (getParentFrame(cont) != null) { jintframe = getParentInternalFrame(cont); if (jintframe != null) { frame = getParentFrame(cont); if (frame instanceof JFrame) { jframe = (JFrame) frame;
/** * Performs the actual choosing of an object. * * @return the chosen object or null if none chosen */ protected Font doChoose() { if (m_FontChooser == null) { if (GUIHelper.getParentDialog(this) != null) m_FontChooser = new FontChooser(GUIHelper.getParentDialog(this)); else m_FontChooser = new FontChooser(GUIHelper.getParentFrame(this)); } m_FontChooser.setCurrent(getCurrent()); m_FontChooser.setVisible(true); return m_FontChooser.getCurrent(); }