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

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

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

JMenu.getSubElements介绍

暂无

代码示例

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

public static void setEnabled(JMenu menu) {
  if (menu.getSubElements().length == 0) {
    menu.setEnabled(false);
  }
}

代码示例来源:origin: girtel/Net2Plan

else if (parent != null) children = parent.getSubElements();
else throw new RuntimeException("Bad");

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

if (change.getSubElements().length > 0)
  add(change);
if (hide.getSubElements().length > 0)
  add(hide);
if (show.getSubElements().length > 0)
  add(show);

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public static void setEnabledForAction
 (JMenu _menu, String _action, boolean _state)
{
 if(_menu==null) return;
 if(_menu.getActionCommand().equals(_action))
  _menu.setEnabled(_state);
 MenuElement[] c=_menu.getSubElements();
 for(int i=0; i<c.length; i++)
 {
  if(c[i] instanceof JMenu)
 setEnabledForAction((JMenu)c[i],_action,_state);
  else
  if(c[i] instanceof JPopupMenu)
 setEnabledForAction((JPopupMenu)c[i],_action,_state);
  else
  if(c[i] instanceof JMenuItem)
 setEnabledForAction((JMenuItem)c[i],_action,_state);
  // else System.err.println("??? "+c[i]);
 }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

MenuElement[] c=_menu.getSubElements();
for(int i=0; i<c.length; i++)

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public static void setCheckedForAction
 (JMenu _menu, String _action, boolean _state)
{
 if(_menu==null) return;
 MenuElement[] c=_menu.getSubElements();
 for(int i=0; i<c.length; i++)
 {
  if(c[i] instanceof JMenu)
 setCheckedForAction((JMenu)c[i],_action,_state);
  else
  if(c[i] instanceof JPopupMenu)
 setCheckedForAction((JPopupMenu)c[i],_action,_state);
  else
  if(c[i] instanceof JCheckBoxMenuItem)
 setCheckedForAction((JCheckBoxMenuItem)c[i],_action,_state);
  else
  if(c[i] instanceof JRadioButtonMenuItem)
 setCheckedForAction((JRadioButtonMenuItem)c[i],_action,_state);
  // else System.err.println("??? "+c[i]);
 }
}

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

if (change.getSubElements().length > 0)
  add(change);
if (link.getSubElements().length > 0)
  add(link);
if (hide.getSubElements().length > 0)
  add(hide);
if (show.getSubElements().length > 0)
  add(show);

代码示例来源:origin: IanWraith/DMRDecode

public void menuItemUpdate () {
  inverted_item.setSelected(theApp.inverted);
  //debug_item.setSelected(theApp.isDebug());
  save_to_file.setSelected(theApp.getLogging());
  quick_log.setSelected(theApp.isQuickLog());
  view_cach.setSelected(theApp.isDisplayCACH());
  view_idle.setSelected(theApp.isDisplayIdlePDU());
  view_voice.setSelected(theApp.isDisplayVoiceFrames());
  view_onlygood.setSelected(theApp.isDisplayOnlyGoodFrames());
  view_display_bar.setSelected(theApp.isEnableDisplayBar());
  //capture_item.setSelected(theApp.isCapture());
  
  // Audio sources
  MenuElement[] devs=audioDevicesMenu.getSubElements();
  if (devs.length>0){
      for (MenuElement m : devs[0].getSubElements()){
        if (((JRadioButtonMenuItem)m).getText().equals(theApp.lineInThread.getMixerName())){
          ((JRadioButtonMenuItem)m).setSelected(true);
          break;
        }
      }
    }
  
}

相关文章