summaryrefslogtreecommitdiff
path: root/javax
diff options
context:
space:
mode:
authorDavid Gilbert <david.gilbert@object-refinery.com>2005-09-23 08:29:04 +0000
committerDavid Gilbert <david.gilbert@object-refinery.com>2005-09-23 08:29:04 +0000
commit1be00f79a2b50b0d77d2c25b1293e0473bd0127f (patch)
tree51241cbacdc36d2a4abf2a69647d48167bf339ac /javax
parentdcc3236c75ad81ce9e636eafd72067b6736e304f (diff)
downloadclasspath-1be00f79a2b50b0d77d2c25b1293e0473bd0127f.tar.gz
2005-09-23 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/plaf/metal/MetalLookAndFeel.java (setCurrentTheme): throw exception if argument is null, improved API docs. ----------------------------------------------------------------------
Diffstat (limited to 'javax')
-rw-r--r--javax/swing/plaf/metal/MetalLookAndFeel.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/javax/swing/plaf/metal/MetalLookAndFeel.java b/javax/swing/plaf/metal/MetalLookAndFeel.java
index db51ea4f6..c8a32494d 100644
--- a/javax/swing/plaf/metal/MetalLookAndFeel.java
+++ b/javax/swing/plaf/metal/MetalLookAndFeel.java
@@ -42,7 +42,9 @@ import java.awt.Color;
import java.awt.Font;
import java.awt.Insets;
+import javax.swing.LookAndFeel;
import javax.swing.UIDefaults;
+import javax.swing.UIManager;
import javax.swing.plaf.BorderUIResource;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.FontUIResource;
@@ -602,12 +604,21 @@ public class MetalLookAndFeel extends BasicLookAndFeel
}
/**
- * Sets the current theme for the look and feel.
+ * Sets the current theme for the look and feel. Note that the theme must be
+ * set <em>before</em> the look and feel is installed. To change the theme
+ * for an already running application that is using the
+ * {@link MetalLookAndFeel}, first set the theme with this method, then
+ * create a new instance of {@link MetalLookAndFeel} and install it in the
+ * usual way (see {@link UIManager#setLookAndFeel(LookAndFeel)}).
*
- * @param theme the theme.
+ * @param theme the theme (<code>null</code> not permitted).
+ *
+ * @throws NullPointerException if <code>theme</code> is <code>null</code>.
*/
public static void setCurrentTheme(MetalTheme theme)
{
+ if (theme == null)
+ throw new NullPointerException("Null 'theme' not permitted.");
MetalLookAndFeel.theme = theme;
}