borland Packages Class Hierarchy dbswing Package
java.lang.Object +----java.awt.Component +----java.awt.Container +----javax.swing.JComponent +----javax.swing.JComboBox +----com.borland.dbswing.JdbComboBox
Variables Constructors Properties Methods Event Listeners
Implements AccessListener, ColumnAware, DataChangeListener, DataSetAware, NavigationListener, ActionListener, ItemListener, ImageObserver, ItemSelectable, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, ListDataListener
JdbComboBox
is a data-aware extension of JComboBox
with the following additional properties:
dataSet
- The DataSet
to which the combo box's selected value is assigned.
columnName
- The name of the Column
of the DataSet
to which the selected value is assigned.
items
- An array of String
s or Object
s to display in the drop-down list.
dropDownWidth
- The desired width of the drop-down list. This property has no effect on the width of columns in a multi-column drop-down derived from a picklist. dropDownWidth
is mainly useful in conjunction with the items
property for displaying a single column drop-down of arbitrary width. To specify the width of an individual column in a picklist drop-down, set the width
property of the corresponding picklist.
If the pickList
property of JdbComboBox
's columnName
has been defined, JdbComboBox
populates its drop-down list as specified in the picklist, displaying multiple columns if necessary.
If both the pickList
and items
properties are set, the items
property takes precedence.
When an editable JdbComboBox
gets its picklist from its items
property, you are allowed to enter values not in the picklist into the column the combo box is bound to. When it gets its picklist from the picklist
property of the bound-to column, you must enter a value from the picklist; editing in the selected text area of the combo box is simply a convenient way to choose a value from the list.
Ordinarily, the selection in a data-aware JdbComboBox
is the current value of the column it is bound to. If this value is not in its list, the message "Unable to locate corresponding value" is displayed when you navigate to a row with an unknown value. This is because the selected text area always displays some value, even when it's empty.
The assumption is that you want to correct these unknown values when you encounter them. If you don't, you probably won't want to use a combo box to display a column containing unknown values.
public JdbComboBox()Constructs a
JdbComboBox
component by calling the constructor of its superclass and makes itself a listener for property change events.
public JdbComboBox(Object[] items)Constructs a
JdbComboBox
component by calling the constructor of its superclass, passing an array of Object
s for the items
parameter, and makes itself a listener for property change events.
items
Objects
that becomes the list of the combo box.
public JdbComboBox(Vector items)Constructs a
JdbComboBox
component by calling the constructor of its superclass, passing a Vector
for the items
parameter, and makes itself a listener for property change events.
items
Vector
that becomes the list of the combo box.
public JdbComboBox(ComboBoxModel model)Constructs a
JdbComboBox
component by calling the constructor of its superclass, passing a ComboBoxModel
as its model
, and makes itself a listener for property change events.
model
ComboBoxModel
that contains the data for the combo box.
public String getColumnName() public void setColumnName(String columnName)Returns and sets the column in a
DataSet
from which data values are read and to which data values are written.
public DataSet getDataSet() public void setDataSet(DataSet dataSet)Returns and sets a
DataSet
from which data values are read and to which data values are written.
public int getDropDownWidth() public void setDropDownWidth(int dropDownWidth)Returns and sets the width in pixels of the drop-down list.
public int getFixedCellHeight() public void setFixedCellHeight(int cellHeight)Returns and sets the fixed height for cells in the combo box's drop-down list.
JdbComboBox
automatically sets this value appropriately when displaying String
data in its drop-down list. To allow non-String
data of variable heights in the combo box, keep the default value of -1.
public synchronized String[] getItems() public synchronized void setItems(String[] items) public synchronized void setItems(Object[] items)Returns and sets an array of
String
s that populates the drop-down list of the combo box.
public int getSelectedIndex() public void setSelectedIndex(int selectedIndex)Returns and sets the index of the selected item in the combo box.
public void addNotify()Calls the
addNotify()
method of the superclass and opens the DataSet
if the dataSet
property is not null
.
protected void commonInit()Calls the
addPropertyChangeListener()
method and passes it this
.
protected void updateSelectedItem()Updates the combo box's selected item to represent the current
DataSet
column value.
public void updateUI()Updates the UI of the combo box.
public void addActionListener(java.awt.event.ActionListener ) public void removeActionListener(java.awt.event.ActionListener )
public void addAncestorListener(javax.swing.event.AncestorListener ) public void removeAncestorListener(javax.swing.event.AncestorListener )
public synchronized void addComponentListener(java.awt.event.ComponentListener ) public synchronized void removeComponentListener(java.awt.event.ComponentListener )
public synchronized void addContainerListener(java.awt.event.ContainerListener ) public synchronized void removeContainerListener(java.awt.event.ContainerListener )
public synchronized void addFocusListener(java.awt.event.FocusListener ) public synchronized void removeFocusListener(java.awt.event.FocusListener )
public synchronized void addInputMethodListener(java.awt.event.InputMethodListener ) public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )
public void addItemListener(java.awt.event.ItemListener ) public void removeItemListener(java.awt.event.ItemListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public synchronized void addMouseListener(java.awt.event.MouseListener ) public synchronized void removeMouseListener(java.awt.event.MouseListener )
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener ) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )
public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener ) public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )