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

javax.swing.IcongetErrorIcon()
get Error Icon
return javax.swing.UIManager.getIcon("OptionPane.errorIcon");
GrayFiltergetGrayFilter()
get Gray Filter
return isUnderDarcula() ? DARCULA_GRAY_FILTER : DEFAULT_GRAY_FILTER;
StringgetGtkThemeName()
get Gtk Theme Name
final LookAndFeel laf = UIManager.getLookAndFeel();
if (laf != null && "GTKLookAndFeel".equals(laf.getClass().getSimpleName())) {
    try {
        final Method method = laf.getClass().getDeclaredMethod("getGtkThemeName");
        method.setAccessible(true);
        final Object theme = method.invoke(laf);
        if (theme != null) {
            return theme.toString();
...
ColorgetHyperlinkForeground()
Returns the color to use for hyperlink-style components.
Color fg = UIManager.getColor("Label.foreground");
if (fg == null) {
    fg = new JLabel().getForeground();
return isLightForeground(fg) ? LIGHT_HYPERLINK_FG : Color.blue;
IcongetIcon(String iconResource)
Returns an icon pointed to by the specified string.
ClassLoader cl = getClassLoaderForResources();
URL iconUrl = cl.getResource(iconResource);
if (iconUrl == null)
    return null;
return new IconUIResource(new ImageIcon(iconUrl));
ColorgetIconForeground()
Returns a fixed foreground color for the custom button icon on win xp.
return UIManager.getColor("PropSheet.customButtonForeground"); 
ColorgetListBackground(final boolean selected)
get List Background
if (selected) {
    if (isUnderNimbusLookAndFeel()) {
        return UIManager.getColor("List[Selected].textBackground"); 
    return UIManager.getColor("List.selectionBackground");
} else {
    if (isUnderNimbusLookAndFeel()) {
        final Color color = UIManager.getColor("List.background");
...
ColorgetListForeground()
get List Foreground
return UIManager.getColor("List.foreground");
ColorgetListForeground(final boolean selected)
get List Foreground
if (selected) {
    final Color color = UIManager.getColor("List.selectionForeground");
    if (color == null) {
        return UIManager.getColor("List[Selected].textForeground"); 
    return color;
} else {
    return UIManager.getColor("List.foreground");
...
intgetMinimumPropPanelHeight()
Minimum height for an instance of PropPanel based on the default font size
if (minH == -1) {
    int base = 18;
    minH = Math.round(base * getFontSizeFactor());
return minH;