List of usage examples for javax.swing AbstractButton ICON_CHANGED_PROPERTY
String ICON_CHANGED_PROPERTY
To view the source code for javax.swing AbstractButton ICON_CHANGED_PROPERTY.
Click Source Link
From source file:AbstractButtonPropertyChangeListener.java
License:asdf
public void propertyChange(PropertyChangeEvent e) { String propertyName = e.getPropertyName(); System.out.println("Property Name: " + propertyName); if (e.getPropertyName().equals(AbstractButton.TEXT_CHANGED_PROPERTY)) { String newText = (String) e.getNewValue(); String oldText = (String) e.getOldValue(); System.out.println(oldText + " changed to " + newText); } else if (e.getPropertyName().equals(AbstractButton.ICON_CHANGED_PROPERTY)) { Icon icon = (Icon) e.getNewValue(); if (icon instanceof ImageIcon) { System.out.println("New icon is an image"); }/*from w ww .jav a 2 s . com*/ } }