1 30 31 package com.jgoodies.looks.common; 32 33 import java.beans.PropertyChangeEvent ; 34 import java.beans.PropertyChangeListener ; 35 import java.io.Serializable ; 36 37 import javax.swing.AbstractButton ; 38 39 import com.jgoodies.looks.LookUtils; 40 import com.jgoodies.looks.Options; 41 42 51 52 public final class ButtonMarginListener implements PropertyChangeListener , Serializable { 53 54 private final String propertyPrefix; 55 56 public ButtonMarginListener(String propertyPrefix) { 57 this.propertyPrefix = propertyPrefix; 58 } 59 60 public void propertyChange(PropertyChangeEvent evt) { 61 AbstractButton button = (AbstractButton ) evt.getSource(); 62 if (Options.IS_NARROW_KEY.equals(evt.getPropertyName())) { 63 LookUtils.installNarrowMargin(button, propertyPrefix); 64 } 65 } 66 67 } | Popular Tags |