javax.swing.JMenuItem.addChangeListener()方法的使用及代码示例

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

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

JMenuItem.addChangeListener介绍

暂无

代码示例

代码示例来源:origin: ron190/jsql-injection

menuHtml.add(menuEncodeHtmlDecimal);
menuEncodeHtmlDecimal.addActionListener(this.actionCoder);
menuEncodeHtmlDecimal.addChangeListener(new ChangeMenuListener("Encode to Html (decimal)"));
  menuEncode.addChangeListener(new ChangeMenuListener("Encode to "+ entryMap.getKey()));
  menuDecode.addChangeListener(new ChangeMenuListener("Decode from "+ entryMap.getKey()));
  JMenuItem menuEncode = new JMenuItem("Hash to "+ hash);
  menuEncode.addActionListener(this.actionCoder);
  menuEncode.addChangeListener(new ChangeMenuListener("Hash to "+ hash));

代码示例来源:origin: kaikramer/keystore-explorer

/**
 * Construct a StatusBarChangeHandler.
 *
 * @param jmi
 *            The menu item
 * @param helpText
 *            Help text for the menu item
 * @param statusBar
 *            The status bar
 */
public StatusBarChangeHandler(JMenuItem jmi, String helpText, StatusBar statusBar) {
  this.jmi = jmi;
  this.helpText = helpText;
  this.statusBar = statusBar;
  jmi.addChangeListener(this);
}

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

menuItem.addActionListener(actionListener);
menuItem.addChangeListener(changeListener);

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

protected void installListeners() {
super.installListeners();
if (changeListener == null)
   changeListener = createChangeListener(menuItem);
if (changeListener != null)
   menuItem.addChangeListener(changeListener);
if (propertyChangeListener == null)
   propertyChangeListener = createPropertyChangeListener(menuItem);
if (propertyChangeListener != null)
   menuItem.addPropertyChangeListener(propertyChangeListener);
  
if (menuListener == null)
   menuListener = createMenuListener(menuItem);
if (menuListener != null)
   ((JMenu)menuItem).addMenuListener(menuListener);
 }

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

@Override
protected void installListeners() {
  super.installListeners();
  if (changeListener == null)
    changeListener = createChangeListener(menuItem);
  if (changeListener != null)
    menuItem.addChangeListener(changeListener);
  if (propertyChangeListener == null)
    propertyChangeListener = createPropertyChangeListener(menuItem);
  if (propertyChangeListener != null)
    menuItem.addPropertyChangeListener(propertyChangeListener);
  if (menuListener == null)
    menuListener = createMenuListener(menuItem);
  if (menuListener != null)
    ((JMenu) menuItem).addMenuListener(menuListener);
}

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

@Override
protected void installListeners() {
  super.installListeners();
  if (changeListener == null)
    changeListener = createChangeListener(menuItem);
  if (changeListener != null)
    menuItem.addChangeListener(changeListener);
  if (propertyChangeListener == null)
    propertyChangeListener = createPropertyChangeListener(menuItem);
  if (propertyChangeListener != null)
    menuItem.addPropertyChangeListener(propertyChangeListener);
  if (menuListener == null)
    menuListener = createMenuListener(menuItem);
  if (menuListener != null)
    ((JMenu) menuItem).addMenuListener(menuListener);
}

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

@Override
protected void installListeners() {
  super.installListeners();
  if (changeListener == null)
    changeListener = createChangeListener(menuItem);
  if (changeListener != null)
    menuItem.addChangeListener(changeListener);
  if (propertyChangeListener == null)
    propertyChangeListener = createPropertyChangeListener(menuItem);
  if (propertyChangeListener != null)
    menuItem.addPropertyChangeListener(propertyChangeListener);
  if (menuListener == null)
    menuListener = createMenuListener(menuItem);
  if (menuListener != null && menuItem instanceof JMenu) {
    ((JMenu) menuItem).addMenuListener(menuListener);
  }
  if (popupMenuListener == null) {
    popupMenuListener = createPopupMenuListener();
  }
  if (popupMenuListener != null && menuItem instanceof JMenu) {
    ((JMenu) menuItem).getPopupMenu().addPopupMenuListener(popupMenuListener);
  }
}

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

for (Component component : components) {
  if (component instanceof JMenuItem) {
    ((JMenuItem) component).addChangeListener(new ChangeListener() {
      public void stateChanged(ChangeEvent e) {
        if (e.getSource() instanceof JMenuItem) {

相关文章

JMenuItem类方法