當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。