pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation());
pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation());
pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation());
pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation());
public static Frame getRootFrame() throws HeadlessException { return JOptionPane.getRootFrame(); } }
/** Is the given component the default Swing hidden frame? */ public static boolean isSharedInvisibleFrame(Component c) { // Must perform an additional check, since applets may // have their own version in their AppContext return c instanceof Frame && (c == JOptionPane.getRootFrame() || c.getClass().getName().startsWith(ROOT_FRAME_CLASSNAME)); }
public static Window findWindow(Component c) { if (c == null) { return JOptionPane.getRootFrame(); } else if (c instanceof Window) { return (Window) c; } else { return findWindow(c.getParent()); } }
/** * Adapted from JOptionPane.getWindowForComponent() */ private static Window getWindowForComponent(Component parentComponent) throws HeadlessException { if (parentComponent == null) return JOptionPane.getRootFrame(); if (parentComponent instanceof Frame || parentComponent instanceof Dialog) return (Window)parentComponent; return getWindowForComponent(parentComponent.getParent()); }
public static Window findWindow(Component c) { if (c == null) { return JOptionPane.getRootFrame(); } else if (c instanceof Window) { return (Window) c; } else { return findWindow(c.getParent()); } }
public static Window findWindow(Component c) { if (c == null) { return JOptionPane.getRootFrame(); } else if (c instanceof Window) { return (Window) c; } else { return findWindow(c.getParent()); } }
public static Window findWindow(Component c) { if (c == null) { return JOptionPane.getRootFrame(); } else if (c instanceof Window) { return (Window) c; } else { return findWindow(c.getParent()); } }
/** * Gets the top level Dialog or Frame of the component. * * @param parentComponent * @return the top level Frame or Dialog. Null if we didn't find an ancestor which is instance of Frame. */ public static Window getWindowForComponent(Component parentComponent) throws HeadlessException { if (parentComponent == null) return JOptionPane.getRootFrame(); if (parentComponent instanceof Frame || parentComponent instanceof Dialog) return (Window) parentComponent; return getWindowForComponent(parentComponent.getParent()); }
private static boolean isUnowned(Window window) { return window.getOwner() == null || (window instanceof JDialog && JOptionPane.getRootFrame().equals(window.getOwner())); }
private static boolean isUnowned(Window window) { return window.getOwner() == null || (window instanceof JDialog && JOptionPane.getRootFrame().equals(window.getOwner())); }
/** Return the {@link Frame} corresponding to the given object. */ public static Frame getFrame(Object o) { Window w = getWindow(o); while (!(w instanceof Frame) && w != null) { w = (Window)w.getParent(); } return w instanceof Frame ? (Frame)w : JOptionPane.getRootFrame(); }
@Override public void actionPerformed(ActionEvent e) { ZooInspectorNodeViewersDialog nvd = new ZooInspectorNodeViewersDialog( JOptionPane.getRootFrame(), nodeViewers, listeners, zooInspectorManager); nvd.setVisible(true); } });
@Override public void actionPerformed(ActionEvent e) { ZooInspectorAboutDialog zicpd = new ZooInspectorAboutDialog( JOptionPane.getRootFrame()); zicpd.setVisible(true); } });
@NotNull public static Window getActiveWindow() { Window[] windows = Window.getWindows(); for (Window each : windows) { if (each.isVisible() && each.isActive()) return each; } return JOptionPane.getRootFrame(); }
/** * Returns a suitable parent window, which is the last explicitly set and * still showing parent window or any of its showing parent windows, the * last focused and still showing window or any of its showing parent * windows or any other showing window - whichever is found first. * If no showing window is found, {@link JOptionPane}'s root frame is * returned. */ public static Window getParentWindow() { Window w; if (null == (w = findFirstShowingWindow(getLastFocusedWindow()))) if (null == (w = getAnyShowingWindow())) w = JOptionPane.getRootFrame(); return w; }
/** * Returns a suitable parent window, which is the last explicitly set and * still showing parent window or any of its showing parent windows, the * last focused and still showing window or any of its showing parent * windows or any other showing window - whichever is found first. * If no showing window is found, {@link JOptionPane}'s root frame is * returned. */ public static Window getParentWindow() { Window w; if (null == (w = findFirstShowingWindow(getLastFocusedWindow()))) if (null == (w = getAnyShowingWindow())) w = JOptionPane.getRootFrame(); return w; }