[Overview] [Sample] [User's Guide] [Tutorial] [Requirements] [Bugs]
Only a few methods of the listbox have been deprecated. The
new version retains and expands on the previous features. In
addition, a previously deprecated property, border
,
has again been added to the listbox's property list.
The addAdjustmentListener(AdjustmentListener, int) method and associated remove method have been deprecated but the feature is still intact. To listen to adjustment events, get the adjuster references from the following methods:
getHorizontalAdjuster() getVerticalAdjuster()
Using the returned Adjustable reference, you can add and remove adjustment listeners.
Note: You should not use these references to set the values of the adjusters.
One of the new features of the listbox is to show and hide the scrollbars only when they are needed. Because of this feature, the methods that set and queried the visibility of the scrollbars have been deprecated in this preview release. Depending on user demand, this functionality may be retained in future releases.
The ListboxEvent.getTime() method has been deprecated and replaced by getWhen() in order to match AWT event naming conventions.
The listbox has changed slightly to allow for additional future enhancements. Column labels can now be any Object reference. In this release version, the captions are still displayed as text strings, however. In future releases of the MultiColumnListbox, the CaptionBar will be able to display Paintable captions as well as strings.
A variety of new features were added to the MultiColumnListbox to expand on its current feature set as well as enable subclasses to extend the listbox in powerful new ways. Despite the many advancements, the listbox is still easy to use.
The MultiColumnListbox has been greatly improved to facilitate its use within leading Java development environments. Because the listbox's data has been broken out into a separate model, the data source can now be wired to the listbox's model property within environments such as IBM's VisualAge for Java.
The data has moved from the listbox to a separate data source Bean. This feature allows the user to populate the contents of the listbox through an object instance that extends the TableModel object. Three model instances are provided with the listbox: Table, FileTable, and DatabaseTable.
Note: If you call a listbox method when no model has been set, the listbox automatically creates a TableModel instance. In this way, the listbox will work the same way that it did in previous versions.
Three TableModel Beans are provided with the MultiColumnListbox:
The horizontal and vertical scrollbars now appear and disappear as needed. The horizontal scrolling has also been improved to provide smooth scrolling action.
Methods have been added to the listbox to allow subclasses to extend the functionality of the listbox in powerful new ways. These methods are:
boolean allowSelection(ListboxEvent event); void deliverEvent(EventObject evt); ListboxCaption createCaption();
New subclasses of the MultiColumnListbox can now control which selection events are allowed and what events are delivered. When the listbox receives a user event to select a row it calls the allowSelection method. By default this method returns true allowing the selection. You can override this method in the subclass to change this behavior, however.
Note: The ListboxEvent now contains the <x,y> coordinate within the element that is selected to add addition flexibility in deciding what selections are allowed.
In addition, you can override the deliverEvent method to prevent events from being delivered or changing them before they are delivered. This method delivers both listbox events as well as caption bar events.
Lastly, to provide the ability to change the appearance of the listbox, the createCaption method was added. This method can be overridden to return a ListboxCaption with different painting behavior.
Possible features planned for future releases of the MultiColumnListbox Bean are:
Copyright Taligent,
Inc. 1996 - 1997.
Copyright © IBM Corporation 1996 - 1997.
All Rights Reserved