javax.swing.JMenu.isPopupMenuVisible()方法的使用及代码示例

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

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

JMenu.isPopupMenuVisible介绍

暂无

代码示例

代码示例来源:origin: deathmarine/Luyten

private void refreshMenuPopup(JMenu menu) {
    try {
      if (menu.isPopupMenuVisible()) {
        menu.getPopupMenu().setVisible(false);
        menu.getPopupMenu().setVisible(true);
      }
    } catch (Exception e) {
      Luyten.showExceptionDialog("Exception!", e);
    }
  }
}.start();

代码示例来源:origin: blurpy/kouchat

/**
 * Checks if any of the menus are visible.
 *
 * @return True if at least one menu is visible.
 */
public boolean isPopupMenuVisible() {
  return fileMenu.isPopupMenuVisible() || toolsMenu.isPopupMenuVisible() || helpMenu.isPopupMenuVisible();
}

代码示例来源:origin: org.appdapter/org.appdapter.lib.gui

@Override public boolean isPopupMenuVisible() {
  return super.isPopupMenuVisible();
}

代码示例来源:origin: blurpy/kouchat

/**
 * Make sure the menubar gets focus when navigating with the keyboard.
 *
 * {@inheritDoc}
 */
@Override
public void focusLost(final FocusEvent e) {
  if (fileMenu.isPopupMenuVisible() || toolsMenu.isPopupMenuVisible()) {
    getRootPane().requestFocusInWindow();
  }
}

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

/** Returns true if there is an active menu on the JFrame (if any)
  containing the given component. */
public static boolean isMenuActive(Component c) {
  Frame f = getFrame(c);
  if (f instanceof JFrame) {
    JFrame frame = (JFrame)f;
    JMenuBar mb = frame.getJMenuBar();
    if (mb != null) {
      for (int i=0;i < mb.getMenuCount();i++) {
        JMenu menu = mb.getMenu(i);
        if (menu == null)
          continue;
        if (menu.isSelected() || menu.isPopupMenuVisible())
          return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: javax.help/javahelp

break;
if (c instanceof JMenu && ((JMenu)c).isPopupMenuVisible()) {
  comp = c;

相关文章