本文整理汇总了Java中javax.swing.UIManager.addPropertyChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java UIManager.addPropertyChangeListener方法的具体用法?Java UIManager.addPropertyChangeListener怎么用?Java UIManager.addPropertyChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.UIManager
的用法示例。
在下文中一共展示了UIManager.addPropertyChangeListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MetalworksFrame
import javax.swing.UIManager; //导入方法依赖的package包/类
public MetalworksFrame() {
super("Metalworks");
final int inset = 50;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(inset, inset, screenSize.width - inset * 2, screenSize.height - inset
* 2);
buildContent();
buildMenus();
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
quit();
}
});
UIManager.addPropertyChangeListener(new UISwitchListener(
(JComponent) getRootPane()));
}
示例2: installPropertyChangeListeners
import javax.swing.UIManager; //导入方法依赖的package包/类
private void installPropertyChangeListeners() {
final WeakReference<TitledBorder> weakReference = new WeakReference<TitledBorder>(this);
final PropertyChangeListener listener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (weakReference.get() == null) {
UIManager.removePropertyChangeListener(this);
UIManager.getDefaults().removePropertyChangeListener(this);
} else {
String prop = evt.getPropertyName();
if ("lookAndFeel".equals(prop) || "LabelUI".equals(prop)) {
label.updateUI();
}
}
}
};
UIManager.addPropertyChangeListener(listener);
UIManager.getDefaults().addPropertyChangeListener(listener);
}
示例3: createWrapperList
import javax.swing.UIManager; //导入方法依赖的package包/类
private JComponent createWrapperList()
{
wrapperModel = new WrapperTableModel();
wrapperList = new JTable();
// Dodgy hack to get Checkboxes in table to display
// with native L&F without changing to flatter L&F.
// There are probably millions of ways to avoid this,
// but I can't find any.
// see Jira Defect TLE-2082 :
// http://apps.dytech.com.au/jira/browse/TLE-2082
UIManager.addPropertyChangeListener(new PropertyChangeListener()
{
@Override
public void propertyChange(PropertyChangeEvent evt)
{
try
{
wrapperList.updateUI();
}
catch( Exception ex )
{
// Ignore
}
}
});
wrapperList.setModel(wrapperModel);
wrapperList.getColumnModel().getColumn(1).setCellRenderer(new OverrideRenderer());
wrapperList.addMouseListener(this);
wrapperList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane scroll = new JScrollPane(wrapperList);
JPanel panel = new JPanel(new TableLayout(new int[]{TableLayout.FILL, TableLayout.PREFERRED},
new int[]{TableLayout.FILL}));
panel.add(scroll, new Rectangle(0, 0, 1, 1));
panel.add(createWrapperSelectButtons(), new Rectangle(0, 1, 1, 1));
return panel;
}
示例4: initialize
import javax.swing.UIManager; //导入方法依赖的package包/类
/** Called by UIManager when this look and feel is installed. */
void initialize() {
// add listener for derived colors
UIManager.addPropertyChangeListener(defaultsListener);
UIManager.getDefaults().addPropertyChangeListener(colorTree);
}