Diamond Edge, Inc.

VB to Java Conversion




Diamond ListView

Displays a collection of objects such as files or folders typically showing an icon and a description label using one of four different views. The View property determines how the objects are arranged:

  • list - single column with small icon and label
  • large icon - displays the large icon with the label underneath and wraps the objects into multiple columns
  • small icon - displays the small icon with the label to the right and wraps the objects into multiple columns
  • details - displays multiple columns of data for each object.
This is the component typically used to display files in a file browser. However, it can be used anywhere a list of objects needs to be displayed.

Each object is represented by a DsListItem object which holds all of the information for the object being displayed including a list of DsListCell objects for each column in the details view. The items can be created in a number of different ways. One way is to call the addItem method. Another way is to use the addItems to add an array or List of objects. If the object added implements the DsListViewObject interface then it is used to fill in the other properties of the DsListItem such as the icons.

Several properties and methods are available to manipulate the columns such as adding columns and changing the width, name, style, etc on each of the columns. The column headers can be displayed in the details view by setting the ColumnHeaderVisible property.

You have full control over the formatting of individual cells or setting the default formatting for all cells in a column in the details view. This includes control of fonts, background color, foreground color, text formats (such as Dates, percent, currency), word wrapping, alignment, borders, 3D text style, and icons. The flexibility, customizability and ease of use is unsurpassed.

Bonus component included:

DsLabel: Displays multiple lines of text and/or icon that a user can't change directly. It is a replacement to and uses the same API as JLabel. It breaks the text up into multiple lines when WordWrap is turned on. Many other additional features are available such as rotation, margins, text styles (3D and highlighting), built-in borders, and font underlining and strikethrough.

You might also want to look a the documentation on-line.

 © Diamond Edge, Inc. All rights reserved.