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

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

本文整理了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

  1. /**
  2. * Creates the button bar
  3. */
  4. @Override
  5. public void onPostCreate() {
  6. super.onPostCreate();
  7. // Default button is 1) the Finish button, 2) the Next button, according
  8. // to the first enabled one.
  9. JButton finishButton = getButton(WizardAction.FINISH);
  10. JButton nextButton = getButton(WizardAction.NEXT);
  11. // Activation of the buttons
  12. PropertyChangeListener listener = new PropertyChangeListener() {
  13. @Override
  14. public void propertyChange(PropertyChangeEvent evt) {
  15. setDefaultButtons();
  16. }
  17. };
  18. // Listens to their enablement
  19. if (finishButton != null) {
  20. finishButton.addPropertyChangeListener("enabled", listener);
  21. }
  22. if (nextButton != null) {
  23. nextButton.addPropertyChangeListener("enabled", listener);
  24. }
  25. // Default state
  26. setDefaultButtons();
  27. }

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

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

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

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

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

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

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

  1. /** Creates new form DependantColorPanel */
  2. public DependantColorPanel() {
  3. initComponents();
  4. colorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
  5. @Override
  6. public void propertyChange(PropertyChangeEvent evt) {
  7. Color newColor = (Color) evt.getNewValue();
  8. propertyEditor.setValue(new DependantColor(newColor));
  9. }
  10. });
  11. parentRadio.addItemListener(this);
  12. customRadio.addItemListener(this);
  13. }

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

  1. /** Creates new form DependantOriginalColorPanel */
  2. public DependantOriginalColorPanel() {
  3. initComponents();
  4. colorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
  5. @Override
  6. public void propertyChange(PropertyChangeEvent evt) {
  7. Color newColor = (Color) evt.getNewValue();
  8. propertyEditor.setValue(new DependantOriginalColor(newColor));
  9. }
  10. });
  11. originalRadio.addItemListener(this);
  12. parentRadio.addItemListener(this);
  13. customRadio.addItemListener(this);
  14. }

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

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

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

  1. public CtuluButtonForPopup(final JButton _main) {
  2. super(CtuluResource.CTULU.getIcon("popup.png"));
  3. setMargin(BuInsets.INSETS0000);
  4. getModel().addChangeListener(this);
  5. addActionListener(this);
  6. mainButton_ = _main;
  7. if (mainButton_ != null) {
  8. mainButton_.addPropertyChangeListener("enabled", this);
  9. mainButton_.getModel().addChangeListener(this);
  10. }
  11. }

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

  1. /** Creates new form EdgeColorPanel */
  2. public EdgeColorPanel() {
  3. initComponents();
  4. colorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
  5. @Override
  6. public void propertyChange(PropertyChangeEvent evt) {
  7. Color newColor = (Color) evt.getNewValue();
  8. propertyEditor.setValue(new EdgeColor(newColor));
  9. }
  10. });
  11. originalRadio.addItemListener(this);
  12. mixedRadio.addItemListener(this);
  13. sourceRadio.addItemListener(this);
  14. targetRadio.addItemListener(this);
  15. customRadio.addItemListener(this);
  16. }

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

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

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

  1. popupButton.addPropertyChangeListener(propertyChangeListener);
  2. popupButton.addMouseListener(mouseListener);
  3. popupButton.addMouseMotionListener(mouseMotionListener);

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

  1. popupButton.addPropertyChangeListener(propertyChangeListener);
  2. popupButton.addMouseListener(mouseListener);
  3. popupButton.addMouseMotionListener(mouseMotionListener);

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

  1. popupButton.addPropertyChangeListener(propertyChangeListener);
  2. popupButton.addMouseListener(mouseListener);
  3. popupButton.addMouseMotionListener(mouseMotionListener);

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

  1. popupButton.addPropertyChangeListener(propertyChangeListener);
  2. popupButton.addMouseListener(mouseListener);
  3. popupButton.addMouseMotionListener(mouseMotionListener);

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

  1. popupButton.addPropertyChangeListener(propertyChangeListener);
  2. popupButton.addMouseListener(mouseListener);
  3. popupButton.addMouseMotionListener(mouseMotionListener);

相关文章

JButton类方法