130 * <pre>
131 * JComponent c;
132 * Font font = c.getFont();
133 * if (font == null || (font instanceof UIResource)) {
134 * c.setFont(UIManager.getFont("fontKey"));
135 * }
136 * </pre>
137 * If the font is {@code null} or a {@code UIResource}, the
138 * defaults table is queried with the key {@code fontKey}. All of
139 * {@code UIDefault's} get methods throw a {@code
140 * NullPointerException} if passed in {@code null}. As such, unless
141 * otherwise noted each of the various install methods of {@code
142 * LookAndFeel} throw a {@code NullPointerException} if the current
143 * value is {@code null} or a {@code UIResource} and the supplied
144 * defaults key is {@code null}. In addition, unless otherwise specified
145 * all of the {@code install} methods throw a {@code NullPointerException} if
146 * a {@code null} component is passed in.
147 *
148 * @author Tom Ball
149 * @author Hans Muller
150 */
151 public abstract class LookAndFeel
152 {
153
154 /**
155 * Convenience method for setting a component's foreground
156 * and background color properties with values from the
157 * defaults. The properties are only set if the current
158 * value is either {@code null} or a {@code UIResource}.
159 *
160 * @param c component to set the colors on
161 * @param defaultBgName key for the background
162 * @param defaultFgName key for the foreground
163 *
164 * @see #installColorsAndFont
165 * @see UIManager#getColor
166 * @throws NullPointerException as described in
167 * <a href="#exceptions">exceptions</a>
168 */
169 public static void installColors(JComponent c,
|
130 * <pre>
131 * JComponent c;
132 * Font font = c.getFont();
133 * if (font == null || (font instanceof UIResource)) {
134 * c.setFont(UIManager.getFont("fontKey"));
135 * }
136 * </pre>
137 * If the font is {@code null} or a {@code UIResource}, the
138 * defaults table is queried with the key {@code fontKey}. All of
139 * {@code UIDefault's} get methods throw a {@code
140 * NullPointerException} if passed in {@code null}. As such, unless
141 * otherwise noted each of the various install methods of {@code
142 * LookAndFeel} throw a {@code NullPointerException} if the current
143 * value is {@code null} or a {@code UIResource} and the supplied
144 * defaults key is {@code null}. In addition, unless otherwise specified
145 * all of the {@code install} methods throw a {@code NullPointerException} if
146 * a {@code null} component is passed in.
147 *
148 * @author Tom Ball
149 * @author Hans Muller
150 * @since 1.2
151 */
152 public abstract class LookAndFeel
153 {
154
155 /**
156 * Convenience method for setting a component's foreground
157 * and background color properties with values from the
158 * defaults. The properties are only set if the current
159 * value is either {@code null} or a {@code UIResource}.
160 *
161 * @param c component to set the colors on
162 * @param defaultBgName key for the background
163 * @param defaultFgName key for the foreground
164 *
165 * @see #installColorsAndFont
166 * @see UIManager#getColor
167 * @throws NullPointerException as described in
168 * <a href="#exceptions">exceptions</a>
169 */
170 public static void installColors(JComponent c,
|