@Override public void updateUI() { super.updateUI(); if (isMixed()) { adjustMixedIcon(); } else { restoreMixedIcon(); } }
/** * This method is called when the selection state changes. * * @param state the new selection state. */ protected void stateUpdated(int state) { if (state == STATE_MIXED) { adjustMixedIcon(); Object cp = UIDefaultsLookup.get("TristateCheckBox.setMixed.clientProperty"); if (cp != null) { putClientProperty(((Object[]) cp)[0], ((Object[]) cp)[1]); // for Aqua L&F } String name = UIDefaultsLookup.getString("TristateCheckBox.setMixed.componentName"); if (name != null) { setName(name); // for Synthetica } } else { restoreMixedIcon(); Object cp = UIDefaultsLookup.get("TristateCheckBox.clearMixed.clientProperty"); if (cp != null) { putClientProperty(((Object[]) cp)[0], ((Object[]) cp)[1]); // for Aqua L&F } String name = UIDefaultsLookup.getString("TristateCheckBox.clearMixed.componentName"); if (name != null) { setName(name); // for Synthetica } } } }