Category: Tables

Tables

Editing Cells

Editing Cells

The data in the table is entirely contrived, but look at how simple it was to set up the combo box editor. In our data model we say that one column has a particular...

Selecting Table Entries

Selecting Table Entries

All this, and all we can do is render and edit data in a table. “What about selecting data?” you ask. Yes, we can do that, too. And, as you might expect, the ListSelectionModel,...

Implementing a Column Model

Implementing a Column Model

Here’s a custom column model that keeps all of its columns in alphabetical order as they are added: Implementing the model is simple. We override addColumn( ) to add the column to the superclass...

The JTable Class

The JTable Class

Table Columns With Swing tables, the basic unit is not an individual cell but a column. Most columns in real-world tables represent a certain type of information that is consistent for all records. For...

Tables in Swing

Tables in Swing

Tables represent one of the most common formats for viewing data. Database records are easy to sort and choose from a table. Statistics on disk usage can be displayed for several computers or several...