当前位置: 首页>>代码示例>>Java>>正文


Java UIManager.addPropertyChangeListener方法代码示例

本文整理汇总了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()));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:MetalworksFrame.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:TitledBorder.java

示例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;
}
 
开发者ID:equella,项目名称:Equella,代码行数:42,代码来源:AdminToolSelect.java

示例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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:NimbusDefaults.java


注:本文中的javax.swing.UIManager.addPropertyChangeListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。