【Java开源代码栏目提醒】:网学会员鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“UISwitchListener.java”一文,供大家参考学习
package BankSystem;
import java.awt.*;
import java.beans.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
/**
* This class listens for UISwitches, and updates a given component.
*
* @version 1.4 04/23/99
* @author Steve Wilson
*/
public class UISwitchListener implements PropertyChangeListener {
JComponent componentToSwitch;
public UISwitchListener(JComponent c) {
componentToSwitch = c;
}
public void propertyChange(PropertyChangeEvent e) {
String name = e.getPropertyName();
if (name.equals("lookAndFeel")) {
SwingUtilities.updateComponentTreeUI(componentToSwitch);
componentToSwitch.invalidate();
componentToSwitch.validate();
componentToSwitch.repaint();
}
}
}