borland Packages  Class Hierarchy  dbswing Package 

JdbComboBox component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----javax.swing.JComponent
                           +----javax.swing.JComboBox
                                   +----com.borland.dbswing.JdbComboBox

About the JdbComboBox component

Variables  Constructors  Properties  Methods  Event Listeners

Implements AccessListener, ColumnAware, DataChangeListener, DataSetAware, NavigationListener, ActionListener, ItemListener, ImageObserver, ItemSelectable, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, ListDataListener

Note: This is a feature of JBuilder Professional and Enterprise.

JdbComboBox is a data-aware extension of JComboBox with the following additional properties:

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.


JdbComboBox variables

Variables implemented in java.awt.Component

Variables implemented in javax.swing.JComboBox

Variables implemented in javax.swing.JComponent

JdbComboBox constructors

JdbComboBox properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.lang.Object

Properties implemented in javax.swing.JComboBox

Properties implemented in javax.swing.JComponent

JdbComboBox methods

Methods implemented in this class

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.lang.Object

Methods implemented in javax.swing.JComboBox

Methods implemented in javax.swing.JComponent

JdbComboBox event listeners


JdbComboBox constructors

JdbComboBox()

  public JdbComboBox()
Constructs a JdbComboBox component by calling the constructor of its superclass and makes itself a listener for property change events.

JdbComboBox(java.lang.Object[])

  public JdbComboBox(Object[] items)
Constructs a JdbComboBox component by calling the constructor of its superclass, passing an array of Objects for the items parameter, and makes itself a listener for property change events.

Parameters:

items
The array of Objects that becomes the list of the combo box.

JdbComboBox(java.util.Vector)

  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.

Parameters:

items
The Vector that becomes the list of the combo box.

JdbComboBox(javax.swing.ComboBoxModel)

  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.

Parameters:

model
The ComboBoxModel that contains the data for the combo box.

JdbComboBox properties

columnName

 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.

dataSet

 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.

dropDownWidth

 public int getDropDownWidth()
 public void setDropDownWidth(int dropDownWidth)
Returns and sets the width in pixels of the drop-down list.

fixedCellHeight

 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.

items

 public synchronized String[] getItems()
 public synchronized void setItems(String[] items)
 public synchronized void setItems(Object[] items)
Returns and sets an array of Strings that populates the drop-down list of the combo box.

selectedIndex

 public int getSelectedIndex()
 public void setSelectedIndex(int selectedIndex)
Returns and sets the index of the selected item in the combo box.

JdbComboBox methods

addNotify()

  public void addNotify()
Calls the addNotify() method of the superclass and opens the DataSet if the dataSet property is not null.

Overrides: com.sun.javax.swing.JComponent.addNotify()

commonInit()

  protected void commonInit()
Calls the addPropertyChangeListener() method and passes it this.

updateSelectedItem()

  protected void updateSelectedItem()
Updates the combo box's selected item to represent the current DataSet column value.

updateUI()

  public void updateUI()
Updates the UI of the combo box.

Overrides: javax.swing.JComboBox.updateUI()


JdbComboBox event listeners

This component is a source for the following event sets.

action

 public void addActionListener(java.awt.event.ActionListener )
 public void removeActionListener(java.awt.event.ActionListener )

ancestor

 public void addAncestorListener(javax.swing.event.AncestorListener )
 public void removeAncestorListener(javax.swing.event.AncestorListener )

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener )
 public synchronized void removeComponentListener(java.awt.event.ComponentListener )

container

 public synchronized void addContainerListener(java.awt.event.ContainerListener )
 public synchronized void removeContainerListener(java.awt.event.ContainerListener )

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener )
 public synchronized void removeFocusListener(java.awt.event.FocusListener )

inputMethod

 public synchronized void addInputMethodListener(java.awt.event.InputMethodListener )
 public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )

item

 public void addItemListener(java.awt.event.ItemListener )
 public void removeItemListener(java.awt.event.ItemListener )

key

 public synchronized void addKeyListener(java.awt.event.KeyListener )
 public synchronized void removeKeyListener(java.awt.event.KeyListener )

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener )
 public synchronized void removeMouseListener(java.awt.event.MouseListener )

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )

propertyChange

 public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener )
 public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )

vetoableChange

 public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener )
 public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )