Java Utililty Methods Swing UIManager

List of utility methods to do Swing UIManager

Description

The list of methods to do Swing UIManager are organized into topic(s).

Method

ColorgetToolTipForeground()
get Tool Tip Foreground
return UIManager.getColor("ToolTip.foreground");
ObjectgetUIDefaultOfClass(Class clazz, String property)
Convenience method for retrieving the UIDefault for a single property of a particular class.
Object retVal = null;
UIDefaults defaults = getUIDefaultsOfClass(clazz);
List<Object> listKeys = Collections.list(defaults.keys());
for (Object key : listKeys) {
    if (key.equals(property)) {
        return defaults.get(key);
    if (key.toString().equalsIgnoreCase(property)) {
...
ObjectgetUIDefaultOfClass(Class clazz, String property)
Convenience method for retrieving the UIDefault for a single property of a particular class.
Object retVal = null;
UIDefaults defaults = getUIDefaultsOfClass(clazz);
List<Object> listKeys = Collections.list(defaults.keys());
for (Object key : listKeys) {
    if (key.equals(property)) {
        return defaults.get(key);
    if (key.toString().equalsIgnoreCase(property)) {
...
UIDefaultsgetUIDefaultsOfClass(String className)
Convenience method for retrieving a subset of the UIDefaults pertaining to a particular class.
UIDefaults retVal = new UIDefaults();
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
List<?> listKeys = Collections.list(defaults.keys());
for (Object key : listKeys) {
    if (key instanceof String && ((String) key).startsWith(className)) {
        String stringKey = (String) key;
        String property = stringKey;
        if (stringKey.contains(".")) {
...
UIDefaultsgetUIDefaultsOfClass(String className)
Convenience method for retrieving a subset of the UIDefaults pertaining to a particular class.
UIDefaults retVal = new UIDefaults();
UIDefaults defaults = javax.swing.UIManager.getLookAndFeelDefaults();
List<?> listKeys = Collections.list(defaults.keys());
for (Object key : listKeys) {
    if ((key instanceof String) && ((String) key).startsWith(className)) {
        String stringKey = (String) key;
        String property = stringKey;
        if (stringKey.contains(".")) {
...
UIDefaultsgetUIDefaultsOfClass(String className)
Convenience method for retrieving a subset of the UIDefaults pertaining to a particular class.
UIDefaults retVal = new UIDefaults();
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
List<?> listKeys = Collections.list(defaults.keys());
for (Object key : listKeys) {
    if (key instanceof String && ((String) key).startsWith(className)) {
        String stringKey = (String) key;
        String property = stringKey;
        if (stringKey.contains(".")) {
...
StringgetUIName(Component comp)
Returns the name used in UIManager for components.
final String res;
if (comp instanceof JComboBox)
    res = "ComboBox";
else if (comp instanceof JTextField || comp instanceof TextField)
    res = "TextField";
else if (comp instanceof JLabel || comp instanceof Label)
    res = "Label";
else
...
ColorgetUIPanelBackground()
get UI Panel Background
return getUIColor("Panel.background");
ColorgetUnfocusedSelectionBackground()
Get the system-wide unfocused selection background color
if (unfocusedSelBg == null) {
    unfocusedSelBg = UIManager.getColor("nb.explorer.unfocusedSelBg"); 
    if (unfocusedSelBg == null) {
        unfocusedSelBg = UIManager.getColor("controlShadow"); 
        if (unfocusedSelBg == null) {
            unfocusedSelBg = Color.lightGray;
        if (!Color.WHITE.equals(unfocusedSelBg.brighter())) {
...
ColorgetUnfocusedSelectionForeground()
Get the system-wide unfocused selection foreground color
if (unfocusedSelFg == null) {
    unfocusedSelFg = UIManager.getColor("nb.explorer.unfocusedSelFg"); 
    if (unfocusedSelFg == null) {
        unfocusedSelFg = UIManager.getColor("textText"); 
        if (unfocusedSelFg == null) {
            unfocusedSelFg = Color.BLACK;
return unfocusedSelFg;