class org.aswing.table.TableColumn extends EventDispatcher

A TableColumn represents all the attributes of a column in a JTable, such as width, resizibility, minimum and maximum width. In addition, the TableColumn provides slots for a renderer and an editor that can be used to display and edit the values in this column.

It is also possible to specify renderers and editors on a per type basis rather than a per column basis - see the setDefaultRenderer method in the JTable class. This default mechanism is only used when the renderer (or editor) in the TableColumn is null.

The TableColumn stores the link between the columns in the JTable and the columns in the TableModel. The modelIndex is the column in the TableModel, which will be queried for the data values for the cells in this column. As the column moves around in the view this modelIndex does not change.

Note: Some implementations may assume that all TableColumnModels are unique, therefore we would recommend that the same TableColumn instance not be added more than once to a TableColumnModel. To show TableColumns with the same column of data from the model, create a new instance with the same modelIndex.

Authors

  • paling

Class Fields

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from EventDispatcher

function addEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool, ?priority:Int, ?useWeakReference:Bool):Void
function dispatchEvent(event:Event):Bool
function hasEventListener(type:String):Bool
function removeEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool):Void
function toString():String
function willTrigger(type:String):Bool

function new(?modelIndex:Int = 0, ?width:Int = 75, ?cellRenderer:TableCellFactory = null, ?cellEditor:TableCellEditor = null): Void

Create a TableColumn.

modelIndex

modelIndex

width

the (optional)width of the column, default to 75

cellRenderer

(optional)the cell renderer for this column cells

cellEditor

(optional)the cell editor for this column cells

function addPropertyChangeListener(listener:Dynamic ->Void?priority:Int = 0, ?useWeakReference:Bool = false): Void

Adds a property change listener.

listener

the listener

priority

the priority

useWeakReference

Determines whether the reference to the listener is strong or weak.

See Also

function removePropertyChangeListener(listener:Dynamic ->Void): Void

Removes a property change listener.

listener

the listener to be removed.

function setCellEditor(cellEditor:TableCellEditor): Void

function setCellFactory(cellRenderer:TableCellFactory): Void

function setHeaderCellFactory(headerRenderer:TableCellFactory): Void

function setIdentifier(identifier:Dynamic): Void

function sizeWidthToFit(): Void

Resizes the TableColumn to fit the width of its header cell. This method does nothing if the header renderer is null (the default case). Otherwise, it sets the minimum, maximum and preferred widths of this column to the widths of the minimum, maximum and preferred sizes of the Component delivered by the header renderer. The transient "width" property of this TableColumn is also set to the preferred width. Note this method is not used internally by the table package.

See Also