diff options
author | Michael Koch <konqueror@gmx.de> | 2002-12-23 12:45:45 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2002-12-23 12:45:45 +0000 |
commit | 8d19a41fa23111a250eff26550db17fd3aceab9b (patch) | |
tree | 5cf5719762c9a09e24e80784d3c0ed2b26194c5f /java/awt/Choice.java | |
parent | 9bb53ea6882e2e21055afcfda7d1185e6973014b (diff) | |
download | classpath-8d19a41fa23111a250eff26550db17fd3aceab9b.tar.gz |
2002-12-23 Michael Koch <konqueror@gmx.de>
* java/awt/Adjustable.java
(HORIZONTAL): Made static final.
(VERTICAL): Made static final.
(NO_ORITENTATION): Made static final.
* java/awt/AlphaComposite.java
(getInstance): Documentation added.
* java/awt/BasicStroke.java
(BasicStroke): Documentation added, reformated code.
* java/awt/CheckboxMenuItem.java
(CheckboxMenuItem): Throw HeadlessException,
added exception documentation.
* java/awt/Choice.java
(Choice): Throw exception, added documentation.
(add): Throw NullPointerException instead of IllegalArgumentException,
added some documentation.
(addItem): Added some documentation.
(insert): Throw exception, added documentation.
* java/awt/Container.java:
Made some documentation looking better.
(getListeners): Added documentation.
(setFocusTraversalKeys): Throw exception.
(getFocusTraversalKeys): Throw exception.
(areFocusTraversalKeys): Throw exception.
* java/awt/Cursor.java
(Cursor): Added documentation.
(getSystemCustomCursor): Throw exception, added documentation.
* java/awt/EventQueue.java
(postEvent): Added documentation.
(invodeAndWait): Added documentation.
(push): Added documentation.
(pop): Added documentation.
(dispatchEvent): Added documentation.
* java/awt/FileDialog.java
(FileDialog): Call setMode() instead of code duplication,
added documentation.
(setMode): Added documentation.
* java/awt/Label.java
(Label): Throw exception, added documentation.
* java/awt/List.java
(List): Throw exception, added documentation.
* java/awt/Menu.java
(Menu): Throw exception, added documentation.
* java/awt/MenuBar.java
(MenuBar): Throw exception, added documentation.
* java/awt/MenuComponent.java
(MenuComponent): Throw exception, added documentation.
* java/awt/PopupMenu.java
(PopupMenu): Throw exception, added documentation.
* java/awt/ScrollPane.java
(ScrollPane): Throw exception, added documentation.
* java/awt/Scrollbar.java
(Scrollbar): Throw exception, added documentation.
* java/awt/TextArea.java
(TextArea): Throw exception, added documentation.
* java/awt/TextField.java
(TextField): Throw exception, added documentation.
* java/awt/Transparency.java
(OPAQUE): Made static final.
(BITMASK): Made static final.
(TRANSLUCENT): Made static final.
* java/awt/color/CMMException.java:
(CMMException): Extends RuntimeException not Exception.
* java/awt/color/ColorSpace.java
(ColorSpace): Implements Serializable.
* java/awt/color/ICC_Profile.java
(write): Throws IOException.
* java/awt/color/ProfileDataException.java
(ProfileDataException): Extends RuntimeException not Exception.
* java/awt/datatransfer/Clipboard.java
(getContents): Added documentation.
(setContents): Added documentation.
* java/awt/datatransfer/DataFlavor.java
(DataFlavor): Added documentation.
(isMimeTypeEqual): Added documentation.
(clone): Added documentation.
(readExternal): Added documentation.
(writeExternal): Added documentation.
* java/awt/datatransfer/SystemDataFlavor.java:
Reintented, Reformated.
(SystemDataFlavor): Added implements FlavorTable.
(getFalvorsForNative): New stubbed method.
(getNativesForFlavor): New stubbed method.
* java/awt/dnd/DragGestureEvent.java
(startDrag): Added documentation.
* java/awt/dnd/DragGestureRecognizer.java
(addDragGestureListener): Added documentation.
* java/awt/dnd/DragSource.java
(DragSource): Throw exception, documentation added.
(getDefaultDragSource): Added documentation.
(startDrag): Added documentation.
(createDragSourceContext): Added documentation.
* java/awt/dnd/DropTarget.java
(DropTarget): Implements DropTargetListener, EventListener,
Serializable.
(isActive): New member variable to save state.
(setActive): Implemented.
(isActive): Implemented.
* java/awt/geom/PathIterator.java:
Fixed two documentations to be HTML conform.
Diffstat (limited to 'java/awt/Choice.java')
-rw-r--r-- | java/awt/Choice.java | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/java/awt/Choice.java b/java/awt/Choice.java index 81a2a31c9..4c7b50553 100644 --- a/java/awt/Choice.java +++ b/java/awt/Choice.java @@ -85,13 +85,17 @@ private ItemListener item_listeners; * Constructors */ -/** - * Initializes a new instance of <code>Choice</code>. - */ -public -Choice() -{ -} + /** + * Initializes a new instance of <code>Choice</code>. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true + */ + public Choice() + { + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); + } /*************************************************************************/ @@ -146,12 +150,16 @@ getItem(int index) * Adds the specified item to this choice box. * * @param item The item to add. + * + * @exception NullPointerException If the item's value is null + * + * @since 1.1 */ public synchronized void add(String item) { if (item == null) - throw new IllegalArgumentException ("item must be non-null"); + throw new NullPointerException ("item must be non-null"); pItems.addElement(item); @@ -171,7 +179,12 @@ add(String item) /** * Adds the specified item to this choice box. * + * This method is oboslete since Java 2 platform 1.1. Please use @see add + * instead. + * * @param item The item to add. + * + * @exception NullPointerException If the item's value is equal to null */ public synchronized void addItem(String item) @@ -189,10 +202,15 @@ addItem(String item) * * @param item The item to add. * @param index The index at which the item should be inserted. + * + * @exception IllegalArgumentException If index is less than 0 */ public synchronized void insert(String item, int index) { + if (index < 0) + throw new IllegalArgumentException ("index may not be less then 0"); + if (index > getItemCount ()) index = getItemCount (); |