Class symantec.itools.awt.ComboBox
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.ComboBox

Object
   |
   +----Component
           |
           +----Container
                   |
                   +----Panel
                           |
                           +----symantec.itools.awt.ComboBox

public class ComboBox
extends Panel
A ComboBox is a text field with an attached drop-down list box. It may be user-editable, "searchable", have horizontal and/or vertical scroll bars, and can use different fonts for the text box and the drop-down list. Also each list box item can have an image in addition to text. A user-editable ComboBox allows the user to enter any desired text into the text field. A searchable ComboBox allows the user to enter text into the text field as long as it matches one of the existing list items. This allows the user to select from a non-editable list by typing instead of dropping-down the list and selecting with the mouse.

Use a ComboBox to:

Version:
1.1, June 6, 1997
Author:
Symantec

Variable Index

 o actionCommand
The command name of the action event fired by this component.
 o actionListener
The action listener to keep track of listeners for our action event.
 o arrow
The button on the right part of this ComboBox that controls dopping the list.
 o arrowDim
The dimension of the arrow button.
 o bCaseSensitive
If true search compares are case-sensitive.
 o bDown
True if the list is currently dropped (displayed).
 o bEditable
If true this ComboBox has a user-editable text field.
 o bOsFlag
True if running under Windows.
 o bOverList
True if the mouse is over the ComboBox.
 o bSearchable
If true this ComboBox is searchable.
 o editBox
The text field part of this ComboBox.
 o hPad
The distance between the direction button and the edit text box.
 o iwidth
The width parameter value in the latest reshape() call.
 o ix
The x parameter value in the latest reshape() call.
 o iy
The y parameter value in the latest reshape() call.
 o lheight
The current height of the list.
 o list
The list part of this ComboBox.
 o maxNumChars
The number of characters of the longest item in the list.
 o sLastText
The latest user-entered text.
 o sSearchItem
The list item string used to match during searches.
 o sSearchOrig
The user-entered string used to match during searches.
 o sSearchText
The case-normalized user-entered string used to match during searches.
 o searchI
The list item currently being checked for search match.
 o searchIndex
Where the selected area starts in the user-entered text.
 o searchLen
The number of items in the list to seach (all).
 o showHScroll
If true the horizontal scroll bar is shown as needed.
 o showVScroll
If true the vertical scroll bar is shown as needed.
 o vPad
The distance between the edit text box and the drop down list.

Constructor Index

 o symantec.itools.awt.ComboBox()
Constructs a new default ComboBox.
 o symantec.itools.awt.ComboBox(boolean, boolean)
Constructs a new editable and/or searchable ComboBox.

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events
 o addFirstTopDown()
Determines whether the ComboBox should be the first component added to its container, or the last.
 o addItem(String)
Adds the specified item to the end of the drop-down list and enables the item.
 o addItem(String, boolean)
Adds the specified item to the end of the drop-down list and conditionally enables it.
 o addItem(Image, String)
Adds the specified item with an image to the end of the drop-down list and enables it.
 o addItem(Image, String, boolean)
Adds the specified item with an image to the end of the drop-down list and conditionally enables it.
 o addLastBottomUp()
Determines whether the ComboBox should be the last component added to its container, or the first.
 o addNotify()
Tells this component that it has been added to a container.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all event changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a vetoable listener for all event changes.
 o changeImage(int, Image)
 o changeText(int, String)
 o clear()
Clears all items from the drop-down list.
 o countItems()
Returns the total number of items in the drop-down list.
 o delItem(int)
Deletes an item from the drop-down list.
 o delItems(int, int)
Deletes multiple items from the drop-down list.
 o delSelectedItem()
Deletes the currently selected item from the list.
 o deselect(int)
Deselects the drop-down list item at the specified zero-relative index.
 o disable(int)
 o dropList(boolean)
 o enable(int)
 o enable(int, boolean)
 o getActionCommand()
 o getCaseSensitive()
 o getEditable()
 o getItem(int)
 o getListItems()
Returns the current list as an array.
 o getListText(int)
Returns the text associated with a drop-down item.
 o getMinimumSize()
Returns the minimum dimensions to properly display this component.
 o getPreferredSize()
Returns the recommended dimensions to properly display this component.
 o getSearchable()
 o getSelectedIndex()
Gets the zero-relative index of the currently selected item in the drop-down list.
 o getSelectedItem()
Returns the selected item on the drop-down list.
 o getShowHorizontalScroll()
 o getShowVerticalScroll()
 o getText()
Returns the text in the edit field portion of the ComboBox, unless the ComboBox is not editable.
 o isCaseSensitive()
Returns the current ComboBox case-sensitive search status.
 o isEditable()
Gets whether the ComboBox is user-editable.
 o isListDown()
Is the list up or down?
 o isSearchable()
Returns the current ComboBox "searchable" status.
 o isSelected(int)
Returns the selection state of the list item at the given zero-relative index.
 o isShowHorizontalScroll()
Gets the current horizontal scrollbar display option.
 o isShowVerticalScroll()
Gets the current vertical scrollbar display option.
 o needsPlatformHelp()
Use this method to set a flag for use in your handleEvent to determine if the ComboBox needs help in "un-dropping".
 o paint(Graphics)
Paints this component using the given graphics context.
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events.
 o removeNotify()
Tells this component that it is being removed from a container.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all event changes.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable listener for all event changes.
 o reshape(int, int, int, int)
Moves and/or resizes this component.
 o reshapeInternals()
A utility routine to resize the sub-components that make up a ComboBox.
 o select(int)
Selects the drop-down list item with the specified zero-relative index.
 o select(String)
Selects the first drop-down item in the list which has exactly matching text.
 o setActionCommand(String)
Sets the command name of the action event fired by this button.
 o setCaseSensitive(boolean)
Conditionally set the ComboBox to be case sensitive during searches.
 o setEditable(boolean)
Conditionally sets the ComboBox to be user-editable.
 o setEnabled(int)
Enables a drop-down list item at a given zero-relative index.
 o setEnabled(int, boolean)
Conditionally enables a drop-down list item at a given zero-relative index.
 o setFont(Font)
Sets the font of the component.
 o setImage(int, Image)
Changes the image associated with a drop-down item.
 o setLayout(LayoutManager)
Takes no action.
 o setListDown(boolean)
Handles dropping and "un-dropping" the ComboBox list.
 o setListItems(String[])
Adds the string array to the list.
 o setListText(int, String)
Changes the text associated with a drop-down item.
 o setSearchable(boolean)
Conditionally sets the ComboBox to be searchable.
 o setShowHorizontalScroll(boolean)
Sets whether or not the horizontal scrollbar should be made visible when necessary or should never be made visible.
 o setShowVerticalScroll(boolean)
Sets whether or not the vertical scrollbar should be made visible when necessary or should never be made visible.
 o setText(String)
Sets the text in the edit field portion of the ComboBox is not editable.
 o sourceActionEvent(String)
Fire an action event to the listeners
 o sourceActionEvent()
Fire an action event to the listeners with the actionCommand
 o updateMaxNumChars()
Used to calculate the preferred size of the text field to determine overall preferred size.
 o validate()
 o verify()
Verify that at least one list item starts with the edit field's text.

Variables

 o actionCommand
protected java.lang.String actionCommand
The command name of the action event fired by this component.

 o actionListener
protected java.awt.event.ActionListener actionListener
The action listener to keep track of listeners for our action event.

 o arrow
protected symantec.itools.awt.DirectionButton arrow
The button on the right part of this ComboBox that controls dopping the list.

 o arrowDim
protected int arrowDim
The dimension of the arrow button.

 o bCaseSensitive
protected boolean bCaseSensitive
If true search compares are case-sensitive.

 o bDown
protected transient boolean bDown
True if the list is currently dropped (displayed).

 o bEditable
protected boolean bEditable
If true this ComboBox has a user-editable text field.

 o bOsFlag
protected static transient boolean bOsFlag
True if running under Windows.

 o bOverList
protected transient boolean bOverList
True if the mouse is over the ComboBox.

 o bSearchable
protected boolean bSearchable
If true this ComboBox is searchable.

 o editBox
protected java.awt.TextField editBox
The text field part of this ComboBox.

 o hPad
protected int hPad
The distance between the direction button and the edit text box.

 o iwidth
protected int iwidth
The width parameter value in the latest reshape() call.

 o ix
protected int ix
The x parameter value in the latest reshape() call.

 o iy
protected int iy
The y parameter value in the latest reshape() call.

 o lheight
protected int lheight
The current height of the list.

 o list
protected symantec.itools.awt.ImageListBox list
The list part of this ComboBox.

 o maxNumChars
protected int maxNumChars
The number of characters of the longest item in the list. Used to calculate preferred size.

See Also:
updateMaxNumChars
 o sLastText
protected transient java.lang.String sLastText
The latest user-entered text.

 o sSearchItem
protected java.lang.String sSearchItem
The list item string used to match during searches.

 o sSearchOrig
protected java.lang.String sSearchOrig
The user-entered string used to match during searches. Not case normalized.

 o sSearchText
protected java.lang.String sSearchText
The case-normalized user-entered string used to match during searches.

 o searchI
protected int searchI
The list item currently being checked for search match.

 o searchIndex
protected int searchIndex
Where the selected area starts in the user-entered text.

 o searchLen
protected int searchLen
The number of items in the list to seach (all).

 o showHScroll
protected boolean showHScroll
If true the horizontal scroll bar is shown as needed.

 o showVScroll
protected boolean showVScroll
If true the vertical scroll bar is shown as needed.

 o vPad
protected int vPad
The distance between the edit text box and the drop down list.

Constructors

 o ComboBox
public ComboBox()
Constructs a new default ComboBox. The ComboBox is not editable and not searchable by default.

 o ComboBox
public ComboBox(boolean editable,
                boolean searchable)
Constructs a new editable and/or searchable ComboBox.

Parameters:
editable - true = editable, false = non-editable
searchable - true = searchable, false = non-searchable

Methods

 o addActionListener
public synchronized void addActionListener(ActionListener l)
Adds the specified action listener to receive action events

Parameters:
l - the action listener
 o addFirstTopDown
public static boolean addFirstTopDown()
Determines whether the ComboBox should be the first component added to its container, or the last. This varies from system to system depending on the native user interface. If this method returns true, add the ComboBox before adding other components. If it returns false, add other components before adding the ComboBox. If the ComboBox is added in the wrong order, the drop-down list box will be drawn under the other components instead of on top of them.

Returns:
if true add the ComboBox to its container before other components, otherwise add after all other components
See Also:
addLastBottomUp
 o addItem
public synchronized void addItem(String item) throws PropertyVetoException
Adds the specified item to the end of the drop-down list and enables the item.

Parameters:
item - the item to be added
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
 o addItem
public synchronized void addItem(String item,
                                 boolean bEnabled) throws PropertyVetoException
Adds the specified item to the end of the drop-down list and conditionally enables it.

Parameters:
item - the item to be added
bEnabled - true = enable the item, false = disable it
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
addItem(java.lang.String), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
 o addItem
public synchronized void addItem(Image image,
                                 String item) throws PropertyVetoException
Adds the specified item with an image to the end of the drop-down list and enables it.

Parameters:
image - the image to display on the item line
item - the item to be added
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
 o addItem
public synchronized void addItem(Image image,
                                 String item,
                                 boolean bEnabled) throws PropertyVetoException
Adds the specified item with an image to the end of the drop-down list and conditionally enables it.

Parameters:
image - the image to display on the item line
item - the item to be added
bEnabled - true = enable the item, false = disable it
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), setListItems(java.lang.String[])
 o addLastBottomUp
public static boolean addLastBottomUp()
Determines whether the ComboBox should be the last component added to its container, or the first. This varies from system to system depending on the native user interface. If this method returns true, add the ComboBox after adding other components. If it returns false, add other components after adding the ComboBox. If the ComboBox is added in the wrong order, the drop-down list box will be drawn under the other components instead of on top of them.

Returns:
if true add the ComboBox to its container after other components, otherwise add before all other components
See Also:
addFirstTopDown
 o addNotify
public synchronized void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer. It has been overridden here to hook-up event listeners.

Overrides:
addNotify in class Panel
See Also:
removeNotify
 o addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all event changes.

Parameters:
listener - the listener to add.
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
Adds a vetoable listener for all event changes.

Parameters:
listener - the listener to add.
See Also:
removeVetoableChangeListener
 o changeImage
public void changeImage(int index,
                        Image image) throws PropertyVetoException
Note: changeImage() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setImage(int, java.awt.Image)
 o changeText
public void changeText(int index,
                       String text) throws PropertyVetoException
Note: changeText() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setListText(int, java.lang.String)
 o clear
public void clear()
Clears all items from the drop-down list.

 o countItems
public int countItems()
Returns the total number of items in the drop-down list.

 o delItem
public synchronized void delItem(int position) throws PropertyVetoException
Deletes an item from the drop-down list.

Parameters:
position - the zero-relative index of the item
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
delItems, addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
 o delItems
public synchronized void delItems(int start,
                                  int end) throws PropertyVetoException
Deletes multiple items from the drop-down list. (Note: the end position must be greater than or equal to the start position.)

Parameters:
start - the starting zero-relative index of the items
end - the ending zero-relative index of the items
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
delItem, addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
 o delSelectedItem
public synchronized void delSelectedItem() throws PropertyVetoException
Deletes the currently selected item from the list.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
 o deselect
public synchronized void deselect(int index) throws PropertyVetoException
Deselects the drop-down list item at the specified zero-relative index.

Parameters:
index - the zero-relative index of the drop-down item to deselect
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
select
 o disable
public void disable(int index) throws PropertyVetoException
Note: disable() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setEnabled(int, boolean)
 o dropList
public void dropList(boolean bDown) throws PropertyVetoException
Note: dropList() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setListDown
 o enable
public void enable(int index) throws PropertyVetoException
Note: enable() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setEnabled(int)
 o enable
public void enable(int index,
                   boolean cond) throws PropertyVetoException
Note: enable() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setEnabled(int, boolean)
 o getActionCommand
public java.lang.String getActionCommand()

Returns:
the command name of the action event fired by this button.
 o getCaseSensitive
public boolean getCaseSensitive()
Note: getCaseSensitive() is deprecated.

See Also:
isSearchable
 o getEditable
public boolean getEditable()
Note: getEditable() is deprecated.

See Also:
isEditable
 o getItem
public java.lang.String getItem(int index)
Note: getItem() is deprecated.

See Also:
getListText(int)
 o getListItems
public java.lang.String[] getListItems()
Returns the current list as an array.

See Also:
setListItems
 o getListText
public java.lang.String getListText(int index)
Returns the text associated with a drop-down item.

Returns:
the text associated with the drop-down item at index
See Also:
setListText(int, java.lang.String)
 o getMinimumSize
public java.awt.Dimension getMinimumSize()
Returns the minimum dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the minimum size of this component. Returns the results of a call to getPreferredSize.

Overrides:
getMinimumSize in class Container
See Also:
getPreferredSize
 o getPreferredSize
public java.awt.Dimension getPreferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component. Preferred size is .

Overrides:
getPreferredSize in class Container
See Also:
getMinimumSize
 o getSearchable
public boolean getSearchable()
Note: getSearchable() is deprecated.

See Also:
isSearchable
 o getSelectedIndex
public int getSelectedIndex()
Gets the zero-relative index of the currently selected item in the drop-down list.

Returns:
the zero-relative index of the current selection, or -1 if no item is selected
See Also:
getSelectedItem
 o getSelectedItem
public java.lang.String getSelectedItem()
Returns the selected item on the drop-down list.

Returns:
the text of the selected item, or null if no item is selected
See Also:
getText, getSelectedIndex
 o getShowHorizontalScroll
public boolean getShowHorizontalScroll()
Note: getShowHorizontalScroll() is deprecated.

See Also:
isShowHorizontalScroll
 o getShowVerticalScroll
public boolean getShowVerticalScroll()
Note: getShowVerticalScroll() is deprecated.

See Also:
isShowVerticalScroll
 o getText
public java.lang.String getText()
Returns the text in the edit field portion of the ComboBox, unless the ComboBox is not editable.

Returns:
the edit field text if editable, or null if this ComboBox is not editable
See Also:
getSelectedItem
 o isCaseSensitive
public boolean isCaseSensitive()
Returns the current ComboBox case-sensitive search status.

See Also:
setSearchable
 o isEditable
public boolean isEditable()
Gets whether the ComboBox is user-editable.

Returns:
true if it is user-editable, false otherwise
See Also:
setEditable
 o isListDown
public boolean isListDown()
Is the list up or down?

Returns:
true if the list is down, false if not.
See Also:
setListDown
 o isSearchable
public boolean isSearchable()
Returns the current ComboBox "searchable" status. A searchable ComboBox allows the user to enter text into the text field as long as it matches one of the existing list items. This allows the user to select from a non-editable list by typing instead of dropping-down the list and selecting with the mouse.

See Also:
setSearchable
 o isSelected
public synchronized boolean isSelected(int index)
Returns the selection state of the list item at the given zero-relative index.

Parameters:
index - the zero-relative index of the drop-down list item to be checked
Returns:
true if the drop-down list item at the specified index has been selected; false otherwise
See Also:
select
 o isShowHorizontalScroll
public boolean isShowHorizontalScroll()
Gets the current horizontal scrollbar display option.

Returns:
true if the horizontal scrollbar should be displayed when necessary, false if the scrollbar should never be shown
See Also:
setShowHorizontalScroll
 o isShowVerticalScroll
public boolean isShowVerticalScroll()
Gets the current vertical scrollbar display option.

Returns:
true if the vertical scrollbar should be displayed when necessary, false if the scrollbar should never be shown
See Also:
setShowVerticalScroll
 o needsPlatformHelp
public static boolean needsPlatformHelp()
Use this method to set a flag for use in your handleEvent to determine if the ComboBox needs help in "un-dropping". This will improve useability under platforms which do not provide proper focus events. For best performance assign a variable in your class once to avoid repeated function calls to this method, like this:
   boolean bNeedsPlatformHelp = ComboBox.needsPlatformHelp();

   public boolean handleEvent(Event evt)
   {
       switch (evt.id)
       {
           case Event.MOUSE_UP:
               // do it on mouse up, which indicates a full click somewhere other than
               // the ComboBox that could be currently dropped down.
               if (bNeedsPlatformHelp && ComboBox.isListDown)
                   ComboBox.setListDown(false);
               break; // or other MOUSE_UP processing as necessary

           ...
       }

       ...
   }
 

See Also:
setListDown
 o paint
public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its [0,0] coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Container
See Also:
repaint, update
 o removeActionListener
public synchronized void removeActionListener(ActionListener l)
Removes the specified action listener so it no longer receives action events.

Parameters:
l - the action listener
 o removeNotify
public synchronized void removeNotify()
Tells this component that it is being removed from a container. This is a standard Java AWT method which gets called by the AWT when this component is removed from a container. Typically, it is used to destroy the peers of this component and all its subcomponents. It has been overridden here to unhook event listeners.

Overrides:
removeNotify in class Container
See Also:
addNotify
 o removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all event changes.

Parameters:
listener - the listener to remove.
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable listener for all event changes.

Parameters:
listener - the listener to remove.
See Also:
addVetoableChangeListener
 o reshape
public synchronized void reshape(int x,
                                 int y,
                                 int width,
                                 int height)
Moves and/or resizes this component. This is a standard Java AWT method which gets called to move and/or resize this component. Components that are in containers with layout managers should not call this method, but rely on the layout manager instead.

Parameters:
x - horizontal position in the parent's coordinate space
y - vertical position in the parent's coordinate space
width - the new width
height - the new height
Overrides:
reshape in class Component
 o reshapeInternals
protected void reshapeInternals()
A utility routine to resize the sub-components that make up a ComboBox.

 o select
public synchronized void select(int index) throws PropertyVetoException
Selects the drop-down list item with the specified zero-relative index.

Parameters:
index - the zero-relative index of the drop-down list item to select
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
deselect
 o select
public void select(String str) throws PropertyVetoException
Selects the first drop-down item in the list which has exactly matching text.

Parameters:
str - the String to match
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
deselect
 o setActionCommand
public void setActionCommand(String command) throws PropertyVetoException
Sets the command name of the action event fired by this button.

Parameters:
command - The name of the action event command fired by this button
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setCaseSensitive
public void setCaseSensitive(boolean bCaseSensitive) throws PropertyVetoException
Conditionally set the ComboBox to be case sensitive during searches.

Parameters:
bCaseSensitive - true = case-sensitive, false = case-insensitive
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getCaseSensitive
 o setEditable
public void setEditable(boolean editable) throws PropertyVetoException
Conditionally sets the ComboBox to be user-editable.

Parameters:
editable - true = editable, false = non-editable
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isEditable
 o setEnabled
public void setEnabled(int index) throws PropertyVetoException
Enables a drop-down list item at a given zero-relative index.

Parameters:
index - the zero-relative index of the drop-down list item
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setEnabled
public void setEnabled(int index,
                       boolean cond) throws PropertyVetoException
Conditionally enables a drop-down list item at a given zero-relative index.

Parameters:
index - the zero-relative index of the drop-down list item
cond - true = enable the item, false = disable it
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setFont
public synchronized void setFont(Font newFont)
Sets the font of the component.

Parameters:
f - the font
Overrides:
setFont in class Component
See Also:
getFont
 o setImage
public void setImage(int index,
                     Image image) throws PropertyVetoException
Changes the image associated with a drop-down item.

Parameters:
index - the zero-relative index of the drop-down item
image - the image to associate with the drop-down item
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setLayout
public void setLayout(LayoutManager lm)
Takes no action. This is a standard Java AWT method which gets called to specify which layout manager should be used to layout the components in standard containers. Since layout managers CANNOT BE USED with this container the standard setLayout has been OVERRIDDEN for this container and does nothing.

Parameters:
lm - the layout manager to use to layout this container's components (IGNORED)
Overrides:
setLayout in class Container
See Also:
getLayout
 o setListDown
public void setListDown(boolean isDown) throws PropertyVetoException
Handles dropping and "un-dropping" the ComboBox list.

Parameters:
isDown - true to drop the list, false to "un-drop" the list.
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isListDown
 o setListItems
public void setListItems(String[] items) throws PropertyVetoException
Adds the string array to the list.

Parameters:
items - items to add to the list
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getListItems, addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean)
 o setListText
public void setListText(int index,
                        String text) throws PropertyVetoException
Changes the text associated with a drop-down item.

Parameters:
index - the zero-relative index of the drop-down item
text - the text to associate with the drop-down item
Throws: PropertyVetoException
if the specified property value is unacceptable
 o setSearchable
public void setSearchable(boolean searchable) throws PropertyVetoException
Conditionally sets the ComboBox to be searchable. A searchable ComboBox allows the user to enter text into the text field as long as it matches one of the existing list items. This allows the user to select from a non-editable list by typing instead of dropping-down the list and selecting with the mouse.

Parameters:
searchable - true = searchable, false = non-searchable
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isSearchable
 o setShowHorizontalScroll
public void setShowHorizontalScroll(boolean cond) throws PropertyVetoException
Sets whether or not the horizontal scrollbar should be made visible when necessary or should never be made visible.

Parameters:
cond - true = show when necessary, false = never show
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isShowHorizontalScroll
 o setShowVerticalScroll
public void setShowVerticalScroll(boolean cond) throws PropertyVetoException
Sets whether or not the vertical scrollbar should be made visible when necessary or should never be made visible.

Parameters:
cond - true = show when necessary, false = never show
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isShowVerticalScroll
 o setText
public void setText(String newText) throws PropertyVetoException
Sets the text in the edit field portion of the ComboBox is not editable.

Parameters:
text - to replace the text of the EditBox
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getSelectedItem
 o sourceActionEvent
protected void sourceActionEvent(String command)
Fire an action event to the listeners

Parameters:
command - the string containing the command to send with the event.
See Also:
sourceActionEvent()
 o sourceActionEvent
protected void sourceActionEvent()
Fire an action event to the listeners with the actionCommand

See Also:
sourceActionEvent(java.lang.String)
 o updateMaxNumChars
protected void updateMaxNumChars()
Used to calculate the preferred size of the text field to determine overall preferred size. Should be called after any manipulation of the list items.

See Also:
getPreferredSize
 o validate
public void validate()
Overrides:
validate in class Container
 o verify
protected void verify()
Verify that at least one list item starts with the edit field's text. If a match is found, the edit field's text is set to that item's value. This is done only if searching is enabled.


All Packages  Class Hierarchy  This Package  Previous  Next  Index