Skip to content

Instantly share code, notes, and snippets.

@lebesnec
Created January 26, 2009 09:25
Show Gist options
  • Save lebesnec/52765 to your computer and use it in GitHub Desktop.
Save lebesnec/52765 to your computer and use it in GitHub Desktop.
someComponent.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("color") && evt.getNewValue() instanceof Color) {
Color color = (Color) evt.getNewValue();
someComponent.setColor(color);
someComponent.repaint();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment