/** * Tries to determine the internal frame this container is part of. * * @param cont the container to start with * @return the parent internal frame if one exists or null if not */ public static JInternalFrame getParentInternalFrame(Container cont) { return (JInternalFrame) getParent(cont, JInternalFrame.class); }
/** * Tries to determine the internal frame this component is part of. * * @param comp the component to start with * @return the parent internal frame if one exists or null if not */ public static JInternalFrame getParentInternalFrame(Component comp) { if (comp instanceof Container) return (JInternalFrame) getParent((Container) comp, JInternalFrame.class); else return null; }
/** * Tries to determine the frame the container is part of. * * @param cont the container to get the frame for * @return the parent frame if one exists or null if not */ public static Frame getParentFrame(Container cont) { return (Frame) getParent(cont, Frame.class); }
/** * Tries to determine the frame the component is part of. * * @param comp the component to get the frame for * @return the parent frame if one exists or null if not */ public static Frame getParentFrame(Component comp) { if (comp instanceof Container) return (Frame) getParent((Container) comp, Frame.class); else return null; }
/** * Tries to determine the dialog this container is part of. * * @param cont the container to get the dialog for * @return the parent dialog if one exists or null if not */ public static Dialog getParentDialog(Container cont) { return (Dialog) getParent(cont, Dialog.class); }
/** * Tries to determine the dialog this component is part of. * * @param comp the component to get the dialog for * @return the parent dialog if one exists or null if not */ public static Dialog getParentDialog(Component comp) { if (comp instanceof Container) return (Dialog) getParent((Container) comp, Dialog.class); else return null; }