diff options
Diffstat (limited to 'libjava/java/awt/Scrollbar.java')
-rw-r--r-- | libjava/java/awt/Scrollbar.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libjava/java/awt/Scrollbar.java b/libjava/java/awt/Scrollbar.java index 1f1875955bf..db4a3fcd2dc 100644 --- a/libjava/java/awt/Scrollbar.java +++ b/libjava/java/awt/Scrollbar.java @@ -1,5 +1,5 @@ /* Scrollbar.java -- AWT Scrollbar widget - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -40,7 +40,6 @@ package java.awt; import java.awt.peer.ScrollbarPeer; import java.awt.peer.ComponentPeer; - import java.awt.event.AdjustmentListener; import java.awt.event.AdjustmentEvent; @@ -126,7 +125,9 @@ private AdjustmentListener adjustment_listeners; /** * Initializes a new instance of <code>Scrollbar</code> with a - * veritical orientation and default values for all other parameters. + * vertical orientation and default values for all other parameters. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public Scrollbar() @@ -145,6 +146,7 @@ Scrollbar() * * @param orientation The orientation of this scrollbar. * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, * @exception IllegalArgumentException If the orientation value is not valid. */ public @@ -168,12 +170,16 @@ Scrollbar(int orientation) throws IllegalArgumentException * @param minimum The minimum value of the scrollbar. * @param maximum The maximum value of the scrollbar. * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, * @exception IllegalArgumentException If the orientation value is not valid. */ public Scrollbar(int orientation, int value, int visibleAmount, int minimum, int maximum) throws IllegalArgumentException { + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); + if ((orientation != HORIZONTAL) && (orientation != VERTICAL)) throw new IllegalArgumentException("Bad orientation value: " + orientation); |