1 package snow.lookandfeel; 2 3 4 import java.awt.*; 5 import java.beans.*; 6 import java.awt.event.*; 7 import javax.swing.*; 8 import javax.swing.event.*; 9 10 11 17 public final class UISwitchListener implements PropertyChangeListener 18 { 19 20 private JComponent componentToSwitch; 21 22 public UISwitchListener(JComponent c) 23 { 24 componentToSwitch = c; 25 } 26 27 public void propertyChange(PropertyChangeEvent e) 28 { 29 String name = e.getPropertyName(); 30 if (name.equals("lookAndFeel")) 31 { 32 SwingUtilities.updateComponentTreeUI(componentToSwitch); 33 componentToSwitch.invalidate(); 34 componentToSwitch.validate(); 35 componentToSwitch.repaint(); 36 } 37 } 38 39 40 41 } 43 44 45 46 47 48 49 50 | Popular Tags |