Extreme Component

ComponentSet Programmer Guide > JListView

JListView - Java Listview Component

JListView provides a Java listview component to display more objects from a list, support 5 different view mode: small icon, large icon, list, details, thumbnail.

Create JListView

Code Samples:

// create JListView
JListView listView = new JListView(createTableModel());
// add a action listener
listView.addActionListener(createActionListener());
// configure the cell renderer and editor
listView.setCellRenderer(new FileCellRenderer());
listView.setCellEditor(new FileCellEditor());

View Mode

The JListView support 5 different view mode: small icon, large icon, list, details, thumbnail.

Support sorting

In order to support sorting, the TableModel used by JListView should implements ColumnSorter interface.

Support Action

When double click or the "ENTER" key on the keyboard has pressed, the JListView component will generate a action event.

Background Image

The JListView comonent support background image.


Copyright (c) zfqjava.com
All rights reserved.