[ Overview ] [ User's Guide ] [ Tutorial ] [ Requirements ]
User's Guide | API Documentation |
Some of the features of the multicolumn listbox are:
All elements within the listbox are Objects. You can put any Object into the listbox and it will draw it. By default, the MultiColumnListbox will only draw the text representation of the Object that you insert. However, you can insert any Java component as well as graphical elements into the listbox. To insert special graphical objects into the listbox, create an object that implements the Paintable interface.
When using a multi-columned listbox, you typically create a series of columns and then, during run-time, rows of data are added, edited, and removed from the list. MultiColumnListbox encapsulates all the methods required to accomplish these and other useful tasks. You can also extend MultiColumnListbox to provide additional functionality.
Each row of data in the listbox has an associated key value that you can set and query. These keys are internal to the listbox and are provided to associate cell data with other internal data structures. All of the keys are Objects, so you can use any class you want as a key value to a row of data.
Users use the MultiColumnListbox the same way that they use a standard system listbox. Users can select and deselect rows in the listbox with a single mouse click. Ranges of contiguous and discontiguous rows can be selected when you set the listbox to allow multiple selections (see setMultipleSelections).
To select a range of rows, first select a single row and then
select a second row while holding down the Shift key. To
add a single row to the list of selected rows, select a row while
holding down the Ctrl key on the Windows platform (or
the key on the Macintosh). The Shift and Ctrl
key even work in combination to add an additional range of rows
to the list of rows already selected.
Where a standard listbox stops, however, the MultiColumnListbox continues in functionality. Because the listbox has multiple columns, it displays a caption bar at the top of the component, spanning the columns you have defined. Each caption labels the column and can be used to select or resize the column.
When a column is selected, the caption appears in bold. If the column is resizable then the cursor will change to indicate that the column is resizable when you move the mouse pointer over the right most edge of the caption. Holding the mouse button down and dragging left or right from this point will change the width of the column. If the column is sortable then a triangle will appear next to the name when the column is selected. The direction of the triangle denotes the direction of the sort (a triangle pointing down is a descending sort).
Taligent made changes to the listbox in order to improve the implementation and to follow the Java 1.1 Bean naming conventions. The most important changes are:
Depending on which features you used in the previous version of the listbox, you may have to make additional changes to your code.
In addition to changes in the new version, several new features and API were added to the Bean. Some of the additions are:
This version of MultiColumnListbox is a Java Bean complete with BeanInfo and Customizer classes. Being a Bean allows the listbox to be added to the Component palette and used in your favorite development environment. Additionally, any customized listbox instance can be completely serialized out to permanent storage and restored later.
Note: The listbox does not serialize the data displayed within the list.
The MultiColumnListbox Bean is included in the package COM.taligent.widget, and is implemented by the following classes:
Copyright ©
Taligent, Inc. 1996 - 1997.
Copyright © IBM Corporation 1996 - 1997.
All Rights Reserved.