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

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

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

JButton.addPropertyChangeListener介绍

暂无

代码示例

代码示例来源:origin: net.sf.doolin/doolin-gui

/**
 * Creates the button bar
 */
@Override
public void onPostCreate() {
  super.onPostCreate();
  // Default button is 1) the Finish button, 2) the Next button, according
  // to the first enabled one.
  JButton finishButton = getButton(WizardAction.FINISH);
  JButton nextButton = getButton(WizardAction.NEXT);
  // Activation of the buttons
  PropertyChangeListener listener = new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      setDefaultButtons();
    }
  };
  // Listens to their enablement
  if (finishButton != null) {
    finishButton.addPropertyChangeListener("enabled", listener);
  }
  if (nextButton != null) {
    nextButton.addPropertyChangeListener("enabled", listener);
  }
  // Default state
  setDefaultButtons();
}

代码示例来源:origin: org.gephi/visualization

final JButton backgroundColorButton = new JColorBlackWhiteSwitcher(vizModel.getBackgroundColor());
backgroundColorButton.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Global.background"));
backgroundColorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
  @Override
  public void propertyChange(PropertyChangeEvent evt) {

代码示例来源:origin: icza/scelight

button.addPropertyChangeListener( AbstractButton.ICON_CHANGED_PROPERTY, new PropertyChangeListener() {

代码示例来源:origin: MegaMek/mekhq

btnSummary.addPropertyChangeListener("missingCount", new PropertyChangeListener() {
  @Override
  public void propertyChange(PropertyChangeEvent evt) {

代码示例来源:origin: org.gephi/desktop-preview

/** Creates new form DependantColorPanel */
public DependantColorPanel() {
  initComponents();
  colorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      Color newColor = (Color) evt.getNewValue();
      propertyEditor.setValue(new DependantColor(newColor));
    }
  });
  parentRadio.addItemListener(this);
  customRadio.addItemListener(this);
}

代码示例来源:origin: org.gephi/desktop-preview

/** Creates new form DependantOriginalColorPanel */
public DependantOriginalColorPanel() {
  initComponents();
  colorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      Color newColor = (Color) evt.getNewValue();
      propertyEditor.setValue(new DependantOriginalColor(newColor));
    }
  });
  originalRadio.addItemListener(this);
  parentRadio.addItemListener(this);
  customRadio.addItemListener(this);
}

代码示例来源:origin: MegaMek/mekhq

dlg.setVisible(true);
});
btnAcquisitions.addPropertyChangeListener("counts", new PropertyChangeListener() {
  @Override
  public void propertyChange(PropertyChangeEvent evt) {

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

public CtuluButtonForPopup(final JButton _main) {
 super(CtuluResource.CTULU.getIcon("popup.png"));
 setMargin(BuInsets.INSETS0000);
 getModel().addChangeListener(this);
 addActionListener(this);
 mainButton_ = _main;
 if (mainButton_ != null) {
  mainButton_.addPropertyChangeListener("enabled", this);
  mainButton_.getModel().addChangeListener(this);
 }
}

代码示例来源:origin: org.gephi/desktop-preview

/** Creates new form EdgeColorPanel */
public EdgeColorPanel() {
  initComponents();
  colorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      Color newColor = (Color) evt.getNewValue();
      propertyEditor.setValue(new EdgeColor(newColor));
    }
  });
  originalRadio.addItemListener(this);
  mixedRadio.addItemListener(this);
  sourceRadio.addItemListener(this);
  targetRadio.addItemListener(this);
  customRadio.addItemListener(this);
}

代码示例来源:origin: org.jspresso.framework/jspresso-swing-application

if (hiddenWhenDisabled) {
 actionButton.setVisible(actionButton.isEnabled());
 actionButton.addPropertyChangeListener("enabled", new PropertyChangeListener() {
  @Override
  public void propertyChange(PropertyChangeEvent evt) {

代码示例来源:origin: org.swinglabs.swingx/swingx-all

popupButton.addPropertyChangeListener(propertyChangeListener);
popupButton.addMouseListener(mouseListener);
popupButton.addMouseMotionListener(mouseMotionListener);

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

popupButton.addPropertyChangeListener(propertyChangeListener);
popupButton.addMouseListener(mouseListener);
popupButton.addMouseMotionListener(mouseMotionListener);

代码示例来源:origin: org.swinglabs.swingx/swingx-core

popupButton.addPropertyChangeListener(propertyChangeListener);
popupButton.addMouseListener(mouseListener);
popupButton.addMouseMotionListener(mouseMotionListener);

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

popupButton.addPropertyChangeListener(propertyChangeListener);
popupButton.addMouseListener(mouseListener);
popupButton.addMouseMotionListener(mouseMotionListener);

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

popupButton.addPropertyChangeListener(propertyChangeListener);
popupButton.addMouseListener(mouseListener);
popupButton.addMouseMotionListener(mouseMotionListener);

相关文章

JButton类方法