* @see #setSelectedIcon
*/
public Icon getSelectedIcon() {
return selectedIcon;
}
/**
* Sets the selected icon for the button.
* @param selectedIcon the icon used as the "selected" image
* @see #getSelectedIcon
* @beaninfo
* bound: true
* attribute: visualUpdate true
* description: The selected icon for the button.
*/
public void setSelectedIcon(Icon selectedIcon) {
Icon oldValue = this.selectedIcon;
this.selectedIcon = selectedIcon;
/* If the default selected icon has really changed and we had
* generated the disabled selected icon for this component,
* (i.e. setDisabledSelectedIcon() was never called) then
* clear the disabledSelectedIcon field.
*/
if (selectedIcon != oldValue &&
disabledSelectedIcon instanceof UIResource) {
disabledSelectedIcon = null;
}
firePropertyChange(SELECTED_ICON_CHANGED_PROPERTY, oldValue, selectedIcon);
if (accessibleContext != null) {
accessibleContext.firePropertyChange(
AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY,
oldValue, selectedIcon);
}
if (selectedIcon != oldValue) {
if (isSelected()) {
repaint();
}
}
}
/**
* Returns the rollover icon for the button.
* @return the <code>rolloverIcon</code> property
* @see #setRolloverIcon
*/
public Icon getRolloverIcon() {
return rolloverIcon;
}
/**
* Sets the rollover icon for the button.
* @param rolloverIcon the icon used as the "rollover" image
* @see #getRolloverIcon
* @beaninfo
* bound: true
* attribute: visualUpdate true
* description: The rollover icon for the button.
*/
public void setRolloverIcon(Icon rolloverIcon) {
Icon oldValue = this.rolloverIcon;
this.rolloverIcon = rolloverIcon;
firePropertyChange(ROLLOVER_ICON_CHANGED_PROPERTY, oldValue, rolloverIcon);
if (accessibleContext != null) {
accessibleContext.firePropertyChange(
AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY,
oldValue, rolloverIcon);
}
setRolloverEnabled(true);
if (rolloverIcon != oldValue) {
// No way to determine whether we are currently in
// a rollover state, so repaint regardless
repaint();
}
}
/**
* Returns the rollover selection icon for the button.
* @return the <code>rolloverSelectedIcon</code> property
* @see #setRolloverSelectedIcon
*/
public Icon getRolloverSelectedIcon() {
return rolloverSelectedIcon;
}
/**
* Sets the rollover selected icon for the button.
* @param rolloverSelectedIcon the icon used as the
* "selected rollover" image
* @see #getRolloverSelectedIcon
* @beaninfo
* bound: true
* attribute: visualUpdate true
* description: The rollover selected icon for the button.
*/
public void setRolloverSelectedIcon(Icon rolloverSelectedIcon) {
Icon oldValue = this.rolloverSelectedIcon;
=6= |