1014: Highlights
- If you want to create a simple table, then call the
JTable
constructor with row and column vectors as arguments.
- If you want to shut off editing, then implement a shadowing
isCellEditable
method in a subclass of the default table model,
and then install an instance of that subclass in the table.
- If you want to change the width of columns, then call the
setPreferredWidth
method, with a target that you obtain by
extracting a particular column-describing instance from the column model
that you obtain from the table.
- If you want to change the way that a cell is rendered, then define a a cell
renderer, and then install an instance of that new renderer in the
table.
- If you want to shut off row selection, then call the
setRowSelectionAllowed
method with the table as the target and
false
as the argument.
- If you want to set up a selection listener, then connect that selection
listener to the list-selection model, that you obtain from the table.
- If you want to set up an editor listener, then connect that editor
listener to the table model that you obtain from the table.