diff options
Diffstat (limited to 'libjava/java/awt/Button.java')
-rw-r--r-- | libjava/java/awt/Button.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libjava/java/awt/Button.java b/libjava/java/awt/Button.java index ed954ddcfda..989fbc95173 100644 --- a/libjava/java/awt/Button.java +++ b/libjava/java/awt/Button.java @@ -90,6 +90,9 @@ private transient ActionListener action_listeners; /** * Initializes a new instance of <code>Button</code> with no label. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true */ public Button() @@ -104,12 +107,18 @@ Button() * label. The action command name is also initialized to this value. * * @param label The label to display on the button. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true */ public Button(String label) { this.label = label; actionCommand = label; + + if (GraphicsEnvironment.isHeadless ()) + throw new HeadlessException (); } /*************************************************************************/ @@ -211,6 +220,10 @@ removeActionListener(ActionListener listener) /** Returns all registered EventListers of the given listenerType. * listenerType must be a subclass of EventListener, or a * ClassClassException is thrown. + * + * @exception ClassCastException If listenerType doesn't specify a class or + * interface that implements @see java.util.EventListener. + * * @since 1.3 */ public EventListener[] getListeners(Class listenerType) |