javax.swing.JMenuBar.getComponent()方法的使用及代码示例

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

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

JMenuBar.getComponent介绍

暂无

代码示例

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = CHILD_JSDOC, params = {"index"})
@Override
public JComponent child(int aIndex) {
  return (JComponent) super.getComponent(aIndex);
}

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

/**
 * Returns all occurences of the specified string in the menus and menu
 * items of the associated menu bar.
 * 
 * @param searchPattern
 *            Pattern to search (no wildcards yet).
 * @return All occurences of the specified string in the menus and menu
 *         items of the associated menu bar.
 */
private LinkedList<SearchResult> findOccurences(String searchPattern) {
  LinkedList<SearchResult> result = new LinkedList<SearchResult>();
  LinkedList<JMenu> currentPath = new LinkedList<JMenu>();
  for (int i = 0; i < jcomp.getComponentCount(); i++) {
    Component component = jcomp.getComponent(i);
    if (component instanceof JMenu) {
      JMenu menu = (JMenu) component;
      this.checkMenu(currentPath, menu, searchPattern, result);
    }
  }
  return result;
}

代码示例来源:origin: bcdev/beam

/**
 * Overrides the base class version in order to create and configure the VISAT's main pane.
 */
@Override
protected JComponent createMainPane() {
  final JMenuBar menuBar = getMainFrame().getJMenuBar();
  JMenu windowMenu = null;
  for (int i = 0; i < menuBar.getComponentCount(); i++) {
    final Component component = menuBar.getComponent(i);
    if (component instanceof JMenu && "window".equals(component.getName())) {
      windowMenu = (JMenu) menuBar.getComponent(i);
    }
  }
  desktopPane.setWindowMenu(windowMenu);
  return desktopPane;
}

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

for (int i = 0; i < MenuSearchWidget.this.jcomp
    .getComponentCount(); i++) {
  if (MenuSearchWidget.this.jcomp.getComponent(i) instanceof SearchPanel) {
    removed = MenuSearchWidget.this.jcomp
        .getComponent(i);
    break;

相关文章