Java Code Examples for javax.swing.UIDefaults#containsKey()

The following examples show how to use javax.swing.UIDefaults#containsKey() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultsDisplay.java    From littleluck with Apache License 2.0 6 votes vote down vote up
public UIDefaultsTableModel() {
    // make a local copy of the defaults table in case the look and feel changes
    defaults = new UIDefaults();
    keys = new ArrayList<Object>();
    UIDefaults realDefaults = UIManager.getDefaults();
    Enumeration keysEnum = realDefaults.keys();
    while (keysEnum.hasMoreElements()) {
        Object key = keysEnum.nextElement();
        if (!defaults.containsKey(key)) {
            keys.add(key);
            defaults.put(key, realDefaults.get(key));
        } else {
            System.out.println("found duplicate key:"+key);
        }
    }
}
 
Example 2
Source File: DefaultsDisplay.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
public UIDefaultsTableModel() {
    // make a local copy of the defaults table in case the look and feel changes
    defaults = new UIDefaults();
    keys = new ArrayList<Object>();
    UIDefaults realDefaults = UIManager.getDefaults();
    Enumeration keysEnum = realDefaults.keys();
    while (keysEnum.hasMoreElements()) {
        Object key = keysEnum.nextElement();
        if (!defaults.containsKey(key)) {
            keys.add(key);
            defaults.put(key, realDefaults.get(key));
        } else {
            System.out.println("found duplicate key:"+key);
        }
    }
}