javax.swing.JOptionPane.getRootFrame()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中javax.swing.JOptionPane.getRootFrame()方法的一些代码示例,展示了JOptionPane.getRootFrame()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JOptionPane.getRootFrame()方法的具体详情如下:
包路径:javax.swing.JOptionPane
类名称:JOptionPane
方法名:getRootFrame

JOptionPane.getRootFrame介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation());

代码示例来源:origin: libgdx/libgdx

pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation());

代码示例来源:origin: libgdx/libgdx

pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation());

代码示例来源:origin: libgdx/libgdx

pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation());

代码示例来源:origin: dsukhoroslov/bagri

public static Frame getRootFrame() throws HeadlessException {
    return JOptionPane.getRootFrame();
  }
}

代码示例来源:origin: abbot/abbot

/** 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));
}

代码示例来源:origin: tmyroadctfig/swingx

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());
  }
}

代码示例来源:origin: EvoSuite/evosuite

/**
 *  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());
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-common

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());
  }
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

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());
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

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());
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

/**
 * 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());
}

代码示例来源:origin: tmyroadctfig/swingx

private static boolean isUnowned(Window window) {
  return window.getOwner() == null || (window instanceof JDialog && JOptionPane.getRootFrame().equals(window.getOwner()));
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-common

private static boolean isUnowned(Window window) {
  return window.getOwner() == null || (window instanceof JDialog && JOptionPane.getRootFrame().equals(window.getOwner()));
}

代码示例来源:origin: abbot/abbot

/** 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();
}

代码示例来源:origin: zzhang5/zooinspector

@Override
  public void actionPerformed(ActionEvent e) {
    ZooInspectorNodeViewersDialog nvd = new ZooInspectorNodeViewersDialog(
        JOptionPane.getRootFrame(), nodeViewers, listeners,
        zooInspectorManager);
    nvd.setVisible(true);
  }
});

代码示例来源:origin: zzhang5/zooinspector

@Override
  public void actionPerformed(ActionEvent e) {
    ZooInspectorAboutDialog zicpd = new ZooInspectorAboutDialog(
        JOptionPane.getRootFrame());
    zicpd.setVisible(true);
  }
});

代码示例来源:origin: JetBrains/jediterm

@NotNull
public static Window getActiveWindow() {
  Window[] windows = Window.getWindows();
  for (Window each : windows) {
    if (each.isVisible() && each.isActive()) return each;
  }
  return JOptionPane.getRootFrame();
}

代码示例来源:origin: net.java.truecommons/truecommons-key-swing

/**
 * 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;
}

代码示例来源:origin: de.schlichtherle.truezip/truezip-swing

/**
 * 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;
}

相关文章