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

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

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

JMenuItem.addPropertyChangeListener介绍

暂无

代码示例

代码示例来源:origin: org.java.net.substance/substance

/**
 * Installs the property change listener on the associated menu item.
 */
public void install() {
  this.menuItem.addPropertyChangeListener(this);
}

代码示例来源:origin: com.github.insubstantial/substance

/**
 * Installs the property change listener on the associated menu item.
 */
public void install() {
  this.menuItem.addPropertyChangeListener(this);
}

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

/** Add listeners to menu items.
* @param items the items
*/
private void addListeners (JMenuItem[] items) {
  int len = items.length;
  for (int i = 0; i < len; i++) {
    items[i].addPropertyChangeListener (this);
  }
}

代码示例来源:origin: khuxtable/seaglass

/**
 * @inheritDoc
 */
@Override
protected void installListeners() {
  super.installListeners();
  menuItem.addPropertyChangeListener(this);
}

代码示例来源:origin: khuxtable/seaglass

protected void installListeners() {
  super.installListeners();
  menuItem.addPropertyChangeListener(this);
}

代码示例来源:origin: com.github.arnabk/pgslookandfeel

protected void installListeners() {
  super.installListeners();
  if (menuItemIconChangeListener == null) {
    menuItemIconChangeListener = new IconChangeListener(menuItem);
  }
  menuItem.addPropertyChangeListener(JMenuItem.ICON_CHANGED_PROPERTY, menuItemIconChangeListener);
}

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

@Override
protected void installListeners() {
  if (_propertyChangeListener == null)
    _propertyChangeListener = createSplitButtonPropertyChangeListener(menuItem);
  if (_propertyChangeListener != null)
    menuItem.addPropertyChangeListener(_propertyChangeListener);
  super.installListeners();
  if (_focusListener == null) {
    _focusListener = new FocusListener() {
      public void focusGained(FocusEvent e) {
        menuItem.repaint();
      }
      public void focusLost(FocusEvent e) {
        menuItem.repaint();
      }
    };
  }
  menuItem.addFocusListener(_focusListener);
}

代码示例来源: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: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

/**	Installs listeners for the associated menu item */
protected void installListeners()
{
  mouseInputListener= createMouseInputListener(menuItem);
  menuDragMouseListener= createMenuDragMouseListener(menuItem);
  menuKeyListener= createMenuKeyListener(menuItem);
  propertyChangeListener= createPropertyChangeListener(menuItem);
  menuItem.addMouseListener(mouseInputListener);
  menuItem.addMouseMotionListener(mouseInputListener);
  menuItem.addMenuDragMouseListener(menuDragMouseListener);
  menuItem.addMenuKeyListener(menuKeyListener);
  menuItem.addPropertyChangeListener(propertyChangeListener);
}

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

protected void installListeners() {
  if ((mouseInputListener = createMouseInputListener(menuItem)) != null) {
    menuItem.addMouseListener(mouseInputListener);
    menuItem.addMouseMotionListener(mouseInputListener);
  }
  if ((menuDragMouseListener = createMenuDragMouseListener(menuItem)) != null) {
    menuItem.addMenuDragMouseListener(menuDragMouseListener);
  }
  if ((menuKeyListener = createMenuKeyListener(menuItem)) != null) {
    menuItem.addMenuKeyListener(menuKeyListener);
  }
  if ((propertyChangeListener = createPropertyChangeListener(menuItem)) != null) {
    menuItem.addPropertyChangeListener(propertyChangeListener);
  }
}

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

protected void installListeners() {
  if ((mouseInputListener = createMouseInputListener(menuItem)) != null) {
    menuItem.addMouseListener(mouseInputListener);
    menuItem.addMouseMotionListener(mouseInputListener);
  }
  if ((menuDragMouseListener = createMenuDragMouseListener(menuItem)) != null) {
    menuItem.addMenuDragMouseListener(menuDragMouseListener);
  }
  if ((menuKeyListener = createMenuKeyListener(menuItem)) != null) {
    menuItem.addMenuKeyListener(menuKeyListener);
  }
  if ((propertyChangeListener = createPropertyChangeListener(menuItem)) != null) {
    menuItem.addPropertyChangeListener(propertyChangeListener);
  }
}

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

protected void installListeners() {
  if ((mouseInputListener = createMouseInputListener(menuItem)) != null) {
    menuItem.addMouseListener(mouseInputListener);
    menuItem.addMouseMotionListener(mouseInputListener);
  }
  if ((menuDragMouseListener = createMenuDragMouseListener(menuItem)) != null) {
    menuItem.addMenuDragMouseListener(menuDragMouseListener);
  }
  if ((menuKeyListener = createMenuKeyListener(menuItem)) != null) {
    menuItem.addMenuKeyListener(menuKeyListener);
  }
  if ((propertyChangeListener = createPropertyChangeListener(menuItem)) != null) {
    menuItem.addPropertyChangeListener(propertyChangeListener);
  }
}

代码示例来源:origin: org.java.net.substance/substance

this.menuItem.addPropertyChangeListener(this.substancePropertyListener);

代码示例来源:origin: com.github.insubstantial/substance

this.menuItem.addPropertyChangeListener(this.substancePropertyListener);

代码示例来源:origin: org.java.net.substance/substance

this.menuItem.addPropertyChangeListener(this.substancePropertyListener);

代码示例来源:origin: org.java.net.substance/substance

this.menuItem.addPropertyChangeListener(this.substancePropertyListener);

代码示例来源:origin: com.github.insubstantial/substance

this.menuItem.addPropertyChangeListener(this.substancePropertyListener);

代码示例来源: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);
  }
}

相关文章

JMenuItem类方法