本文整理匯總了Java中javax.swing.UIDefaults.addPropertyChangeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java UIDefaults.addPropertyChangeListener方法的具體用法?Java UIDefaults.addPropertyChangeListener怎麽用?Java UIDefaults.addPropertyChangeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.UIDefaults
的用法示例。
在下文中一共展示了UIDefaults.addPropertyChangeListener方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: install
import javax.swing.UIDefaults; //導入方法依賴的package包/類
private static void install() {
// don't install directory chooser if standard chooser is desired
if (isStandardChooserForced()) {
return;
}
final UIDefaults uid = UIManager.getDefaults();
originalImpl = (Class<?>) uid.getUIClass(KEY);
Class<?> impl = DelegatingChooserUI.class;
final String val = impl.getName();
// don't install dirchooser if quickfilechooser is present
if (!isQuickFileChooser(uid.get(KEY))) {
uid.put(KEY, val);
// To make it work in NetBeans too:
uid.put(val, impl);
}
// #61147: prevent NB from switching to a different UI later (under GTK):
uid.addPropertyChangeListener(pcl = new PropertyChangeListener() {
public @Override void propertyChange(PropertyChangeEvent evt) {
String name = evt.getPropertyName();
Object className = uid.get(KEY);
if ((name.equals(KEY) || name.equals("UIDefaults")) && !val.equals(className)
&& !isQuickFileChooser(className)) {
originalImpl = (Class<?>) uid.getUIClass(KEY);
uid.put(KEY, val);
}
}
});
}