aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/CheckboxMenuItem.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/awt/CheckboxMenuItem.java')
-rw-r--r--libjava/java/awt/CheckboxMenuItem.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/libjava/java/awt/CheckboxMenuItem.java b/libjava/java/awt/CheckboxMenuItem.java
index 2f7ecd79fc5..88218397c3c 100644
--- a/libjava/java/awt/CheckboxMenuItem.java
+++ b/libjava/java/awt/CheckboxMenuItem.java
@@ -84,6 +84,9 @@ private transient ItemListener item_listeners;
/**
* Initializes a new instance of <code>CheckboxMenuItem</code> with no
* label and an initial state of off.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+ * returns true.
*/
public
CheckboxMenuItem()
@@ -98,6 +101,9 @@ CheckboxMenuItem()
* specified label and an initial state of off.
*
* @param label The label of the menu item.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+ * returns true.
*/
public
CheckboxMenuItem(String label)
@@ -114,12 +120,18 @@ CheckboxMenuItem(String label)
* @param label The label of the menu item.
* @param state The initial state of the menu item, where <code>true</code>
* is on, and <code>false</code> is off.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless()
+ * returns true.
*/
public
CheckboxMenuItem(String label, boolean state)
{
super(label);
this.state = state;
+
+ if (GraphicsEnvironment.isHeadless())
+ throw new HeadlessException ();
}
/*************************************************************************/