class org.aswing.JTable extends Container

The JTable is used to display and edit regular two-dimensional tables of cells.

The JTable has many facilities that make it possible to customize its rendering and editing but provides defaults for these features so that simple tables can be set up easily. For example, to set up a table with 10 rows and 10 columns of numbers:

class MyTableModel extends AbstractTableModel{
public function getColumnCount():int { return 10; }
public function getRowCount():int { return 10;}
public getValueAt(row:int, col:int) { return row*col; }
};
var dataModel:MyTableModel = new MyTableModel();
var table:JTable = new JTable(dataModel);
var scrollpane:JScrollPane = new JScrollPane(table);

Note that if you wish to use a JTable in a standalone view (outside of a JScrollPane) and want the header displayed, you can get it using {@link #getTableHeader} and display it separately.

When designing applications that use the JTable it is worth paying close attention to the data structures that will represent the table's data. The DefaultTableModel is a model implementation that uses a Vector of Vectors of Objects to store the cell values. As well as copying the data from an application into the DefaultTableModel, it is also possible to wrap the data in the methods of the TableModel interface so that the data can be passed to the JTable directly, as in the example above. This often results in more efficient applications because the model is free to choose the internal representation that best suits the data. A good rule of thumb for deciding whether to use the AbstractTableModel or the DefaultTableModel is to use the AbstractTableModel as the base class for creating subclasses and the DefaultTableModel when subclassing is not required.

The JTable uses integers exclusively to refer to both the rows and the columns of the model that it displays. The JTable simply takes a tabular range of cells and uses getValueAt(int, int) to retrieve the values from the model during painting.

By default, columns may be rearranged in the JTable so that the view's columns appear in a different order to the columns in the model. This does not affect the implementation of the model at all: when the columns are reordered, the JTable maintains the new order of the columns internally and converts its column indices before querying the model.

To listen table row selection change event, by this.addSelectionListener() To listen column selection see org.aswing.table.TableColumnModel.addColumnModelListener
To listen other Table events see org.aswing.table.TableModel.addTableModelListener

Authors

  • paling

Class Fields

static var AUTO_INCREMENT:Int

The default unit/block increment, it means auto count a value.

static var AUTO_RESIZE_ALL_COLUMNS:Int

During all resize operations, proportionately resize all columns.

static var AUTO_RESIZE_LAST_COLUMN:Int

During all resize operations, apply adjustments to the last column only.

static var AUTO_RESIZE_NEXT_COLUMN:Int

When a column is adjusted in the UI, adjust the next column the opposite way.

static var AUTO_RESIZE_OFF:Int

Do not adjust column widths automatically; use a scrollbar.

static var AUTO_RESIZE_SUBSEQUENT_COLUMNS:Int

During UI adjustment, change subsequent columns to preserve the total width; this is the default behavior.

static var MULTIPLE_SELECTION:Int

Can select any item at a time.

static var SINGLE_SELECTION:Int

Only can select one most item at a time.

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from Container

var layout:LayoutManager
function append(com:Component, ?constraints:Dynamic):Void
function appendAll(coms:Array<Dynamic>):Void
function doLayout():Void
function getComponent(index:Int):Component
function getComponentCount():Int
function getComponents():Array<Dynamic>
function getFocusTraversalPolicy():FocusTraversalPolicy
function getIndex(com:Component):Int
function getLayout():LayoutManager
function insert(i:Int, com:Component, ?constraints:Dynamic):Void
function insertAll(index:Int, coms:Array<Dynamic>):Void
function invalidate():Void
function isAncestorOf(c:Component):Bool
function reAppendChildren():Void
function remove(com:Component):Component
function removeAll():Void
function removeAt(i:Int):Component
function removeChild(child:DisplayObject):DisplayObject
function removeChildAt(index:Int):DisplayObject
function setFocusTraversalPolicy(ftp:FocusTraversalPolicy):Void
function setLayout(layout:LayoutManager):Void
function validate():Void

Inherited from Component

var alignmentX:Float
var alignmentY:Float
var background:ASColor
var backgroundDecorator:GroundDecorator
var border:Border
var bounds:IntRectangle
var clipBounds:IntRectangle
var constraints:Dynamic
var currentSize:IntDimension
var dragEnabled:Bool
var dropTrigger:Bool
var enabled:Bool
var focusable:Bool
var focusableSet:Bool
var font:ASFont
var foreground:ASColor
var foregroundDecorator:GroundDecorator
var location:IntPoint
var maximumSize:IntDimension
var mideground:ASColor
var minimumSize:IntDimension
var opaque:Bool
var opaqueSet:Bool
var preferredSize:IntDimension
var resizerMargin:Insets
var styleProxy:Component
var styleTune:StyleTune
var toolTipText:String
var transitFocusFactor:Float
var ui:ComponentUI
var uiElement:Bool
var visibility:Bool
function addDragAcceptableInitiator(com:Component):Void
function componentToGlobal(p:IntPoint):IntPoint
function getClientProperty(key:String, ?defaultValue:Dynamic):Dynamic
function getDefaultBasicUIClass():Class<Dynamic>
function getFocusManager():FocusManager
function getGlobalLocation(?rv:IntPoint):IntPoint
function getInsets():Insets
function getInternalFocusObject():InteractiveObject
function getKeyboardManager():KeyboardManager
function getMousePosition():IntPoint
function getPaintBounds():IntRectangle
function getParent():Container
function getRootPaneAncestor():JRootPane
function getUIClassID():String
function globalToComponent(p:IntPoint):IntPoint
function hitTestMouse():Bool
function invalidate():Void
function invalidatePreferSizeCaches():Void
function isCachePreferSizes():Bool
function isDragAcceptableInitiator(com:Component):Bool
function isFocusOwner():Bool
function isFontValidated():Bool
function isOnStage():Bool
function isShowing():Bool
function isValid():Bool
function isValidateRoot():Bool
function makeFocus():Void
function pack():Void
function paintFocusRect(?force:Bool):Void
function paintImmediately():Void
function parentReAppendChildren():Void
function putClientProperty(key:String, value:Dynamic):Void
function reAppendToParent(?constraints:Dynamic):Void
function removeDragAcceptableInitiator(com:Component):Void
function removeFromContainer():Void
function repaint():Void
function repaintAndRevalidate():Void
function requestFocus():Bool
function revalidate():Void
function setCachePreferSizes(b:Bool):Void
function setClipSize(size:IntDimension):Void
function setDragAcceptableInitiatorAppraiser(func:Dynamic ->Bool):Void
function setFontValidated(b:Bool):Void
function setGlobalLocation(gp:IntPoint):Void
function transferFocus():Bool
function transferFocusBackward():Bool
function updateUI():Void
function validate():Void

Inherited from AWSprite

function bringToBottom(child:DisplayObject):Void
function bringToTop(child:DisplayObject):Void
function containsChild(child:DisplayObject):Bool
function getHighestIndexUnderForeground():Int
function getLowestIndexAboveBackground():Int
function isClipMasked():Bool
function setChildIndex(child:DisplayObject, index:Int):Void
function setClipMaskRect(b:IntRectangle):Void
function setClipMasked(m:Bool):Void
function toString():String

Inherited from Sprite

var buttonMode:Bool
var dropTarget:DisplayObject
var graphics:Graphics
var hitArea:Sprite
var soundTransform:SoundTransform
var useHandCursor:Bool
function startDrag(?lockCenter:Bool, ?bounds:Rectangle):Void
function startTouchDrag(touchPointID:Int, ?lockCenter:Bool, ?bounds:Rectangle):Void
function stopDrag():Void
function stopTouchDrag(touchPointID:Int):Void

Inherited from DisplayObjectContainer

var mouseChildren:Bool
var numChildren:Int
var tabChildren:Bool
var textSnapshot:TextSnapshot
function addChild(child:DisplayObject):DisplayObject
function addChildAt(child:DisplayObject, index:Int):DisplayObject
function areInaccessibleObjectsUnderPoint(point:Point):Bool
function contains(child:DisplayObject):Bool
function getChildAt(index:Int):DisplayObject
function getChildByName(name:String):DisplayObject
function getChildIndex(child:DisplayObject):Int
function getObjectsUnderPoint(point:Point):Array<DisplayObject>
function removeChild(child:DisplayObject):DisplayObject
function removeChildAt(index:Int):DisplayObject
function setChildIndex(child:DisplayObject, index:Int):Void
function swapChildren(child1:DisplayObject, child2:DisplayObject):Void
function swapChildrenAt(index1:Int, index2:Int):Void

Inherited from InteractiveObject

var accessibilityImplementation:AccessibilityImplementation
var contextMenu:ContextMenu
var doubleClickEnabled:Bool
var focusRect:Dynamic
var mouseEnabled:Bool
var tabEnabled:Bool
var tabIndex:Int

Inherited from DisplayObject

var accessibilityProperties:AccessibilityProperties
var alpha:Float
var blendMode:BlendMode
var blendShader:Shader
var cacheAsBitmap:Bool
var filters:Array<BitmapFilter>
var height:Float
var loaderInfo:LoaderInfo
var mask:DisplayObject
var mouseX:Float
var mouseY:Float
var name:String
var opaqueBackground:Null<UInt>
var parent:DisplayObjectContainer
var root:DisplayObject
var rotation:Float
var rotationX:Float
var rotationY:Float
var rotationZ:Float
var scale9Grid:Rectangle
var scaleX:Float
var scaleY:Float
var scaleZ:Float
var scrollRect:Rectangle
var stage:Stage
var transform:Transform
var visible:Bool
var width:Float
var x:Float
var y:Float
var z:Float
function getBounds(targetCoordinateSpace:DisplayObject):Rectangle
function getRect(targetCoordinateSpace:DisplayObject):Rectangle
function globalToLocal(point:Point):Point
function globalToLocal3D(point:Point):Vector3D
function hitTestObject(obj:DisplayObject):Bool
function hitTestPoint(x:Float, y:Float, ?shapeFlag:Bool):Bool
function local3DToGlobal(point3d:Vector3D):Point
function localToGlobal(point:Point):Point

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

var autoResizeMode:Int

The table's auto resize mode when the table is resized.

One of 5 legal values: this.AUTO_RESIZE_OFF, this.AUTO_RESIZE_NEXT_COLUMN, this.AUTO_RESIZE_SUBSEQUENT_COLUMNS, this.AUTO_RESIZE_LAST_COLUMN, this.AUTO_RESIZE_ALL_COLUMNS

The default mode is this.AUTO_RESIZE_SUBSEQUENT_COLUMNS.

var cellSelectionEnabled:Bool

Whether this table allows both a column selection and a row selection to exist simultaneously.

When set, the table treats the intersection of the row and column selection models as the selected cells.

Override this.isCellSelected to change this default behavior.

This property is equivalent to setting both the this.rowSelectionAllowed property and this.columnSelectionAllowed property to the supplied value.

See Also

var cellSpacing:IntDimension

The height and width of the space between cells.

var columnModel:TableColumnModel

The column model for this table

var dataModel:TableModel

The data model for this table to newModel and registers with it for listener notifications from the new data model.

var gridColor:ASColor

The color used to draw grid lines.

The default color is look and feel dependent.

var horizontalBlockIncrement:Int

The block value for the Horizontal scrolling.

var horizontalUnitIncrement:Int

The unit value for the Horizontal scrolling.

var preferredViewportSize:IntDimension

The preferred size of the viewport for this table.

var rowHeight:Int

The height, in pixels, of all cells.

The height of the cells will be equal to the row height minus the row margin.

default value

20

var rowMargin:Int

The amount of empty space between cells in adjacent rows.

var selectedItem:Dynamic

It works only if dataModel is PropertyTableModel or TableSorter with PropertyTableModel inside.

var selectionMode:Int

Sets the table's selection mode to allow only single selections, a single contiguous interval, or multiple intervals.

Note: JTable provides all the methods for handling column and row selection. When setting states, such as setSelectionMode, it not only updates the mode for the row selection model but also sets similar values in the selection model of the columnModel. If you want to have the row and column selection models operating in different modes, set them both directly.

Both the row and column selection models for JTable default to using a DefaultListSelectionModel so that JTable works the same way as the JList. See the setSelectionMode method in JList for details about the modes.

var selectionModel:ListSelectionModel

The row selection model for this table

var showHorizontalLines:Bool

Whether the table draws horizontal lines between cells.

You may also need to use cellSpacing to set a proper gap of columns and rows to avoid lines effect caused by different bgs between table and cell.

See Also

var showVerticalLines:Bool

Whether the table draws vertical lines between cells. If this.showVerticalLines is true it does; if it is false it doesn't.

You may also need to call setIntercellSpacing() to set a proper gap of columns and rows to avoid lines effect caused by different bgs between table and cell.

var verticalBlockIncrement:Int

The block value for the Vertical scrolling.

var verticalUnitIncrement:Int

The unit value for the Vertical scrolling.

function new(?dm:TableModel = null): Void

Constructs a default JTable.

function addColumn(aColumn:TableColumn): Void

Appends aColumn to the end of the array of columns held by this JTable's column model. If the column name of aColumn is null, sets the column name of aColumn to the name returned by getModel().getColumnName().

To add a column to this JTable to display the modelColumn'th column of data in the model with a given width, cellRenderer, and cellEditor you can use:

 addColumn(new TableColumn(modelColumn, width, cellRenderer, cellEditor));

[Any of the `TableColumn` constructors can be used instead of this one.] The model column number is stored inside the TableColumn and is used during rendering and editing to locate the appropriates data values in the model. The model column number does not change when columns are reordered in the view.

@param aColumn the TableColumn to be added @see #removeColumn

function addColumnSelectionInterval(index0:Int, index1:Int, ?programmatic:Bool = true): Void

Adds the columns from index0 to index1, inclusive, to the current selection.

@param programmatic indicate if this is a programmatic change

index0

one end of the interval

index1

the other end of the interval *

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

Adds a listener to column selection changed.

listener

the listener to be add.

priority

the priority

useWeakReference

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

See Also

function addRowSelectionInterval(index0:Int, index1:Int, ?programmatic:Bool = true): Void

Adds the rows from index0 to index1, inclusive, to the current selection.

@param programmatic indicate if this is a programmatic change

index0

one end of the interval

index1

the other end of the interval *

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

Adds a listener to row selection changed.

listener

the listener to be add.

priority

the priority

useWeakReference

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

See Also

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

Add a listener to listen the viewpoat state change event.

When the viewpoat's state changed, the state is all about:

  • viewPosition
  • verticalUnitIncrement
  • verticalBlockIncrement
  • horizontalUnitIncrement
  • horizontalBlockIncrement

listener

the listener

priority

the priority

useWeakReference

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

See Also

function changeSelection(rowIndex:Int, columnIndex:Int, toggle:Bool, extend:Bool, ?programmatic:Bool = true): Void

Updates the selection models of the table, depending on the state of the two flags: toggle and extend. Most changes to the selection that are the result of keyboard or mouse events received by the UI are channeled through this method so that the behavior may be overridden by a subclass. Some UIs may need more functionality than this method provides, such as when manipulating the lead for discontiguous selection, and may not call into this method for some selection changes.

This implementation uses the following conventions:

  • toggle: false, extend: false. Clear the previous selection and ensure the new cell is selected.
  • toggle: false, extend: true. Extend the previous selection from the anchor to the specified cell, clearing all other selections.
  • toggle: true, extend: false. If the specified cell is selected, deselect it. If it is not selected, select it.
  • toggle: true, extend: true. Leave the selection state as it is, but move the anchor index to the specified location.
@param programmatic indicate if this is a programmatic change

rowIndex

affects the selection at row

columnIndex

affects the selection at column

toggle

see description above

extend

if true, extend the current selection *

function clearSelection(?programmatic:Bool = true): Void

Deselects all selected columns and rows.

programmatic

indicate if this is a programmatic change

function columnAtPoint(point:IntPoint): Int

Returns the index of the column that point lies in, or -1 if the result is not in the range [0, `getColumnCount()`-1].

point

the location of interest

returns

the index of the column that point lies in, or -1 if the result is not in the range [0, `getColumnCount()`-1]

See Also

function convertColumnIndexToModel(viewColumnIndex:Int): Int

Maps the index of the column in the view at viewColumnIndex to the index of the column in the table model. Returns the index of the corresponding column in the model. If viewColumnIndex is less than zero, returns viewColumnIndex.

viewColumnIndex

the index of the column in the view

returns

the index of the corresponding column in the model

function convertColumnIndexToView(modelColumnIndex:Int): Int

Maps the index of the column in the table model at modelColumnIndex to the index of the column in the view. Returns the index of the corresponding column in the view; returns -1 if this column is not being displayed. If modelColumnIndex is less than zero, returns modelColumnIndex.

modelColumnIndex

the index of the column in the model

returns

the index of the corresponding column in the view

See Also

function createDefaultColumnsFromModel(): Void

Creates default columns for the table from the data model using the this.getColumnCount method defined in the TableModel interface.

Clears any existing columns before creating the new columns based on information from the model.

function editCellAt(row:Int, column:Int, ?clickCount:Int = -1): Bool

editCellAt(row:int, column:int, clickCount:int):Boolean
editCellAt(row:int, column:int):Boolean

Programmatically starts editing the cell at row and column, if those indices are in the valid range, and the cell at those indices is editable.

row

the row to be edited

column

the column to be edited

clickCount

the click count, if force to edite, pass -1 to this param.

returns

false if for any reason the cell cannot be edited, or if the indices are invalid

function ensureCellIsVisible(row:Int, column:Int): Void

Scrolls the JTable to make the specified cell completely visible.

row

the row index

column

the column index

function getCellFactory(row:Int, column:Int): TableCellFactory

function getCellPane(): Container

Returns the container that holds the cells.

returns

the container that holds the cells.

function getCellRect(row:Int, column:Int, includeSpacing:Bool): IntRectangle

Returns a rectangle for the cell that lies at the intersection of row and column.

If includeSpacing is true then the value returned has the full height and width of the row and column specified. If it is false, the returned rectangle is inset by the intercell spacing to return the true bounds of the rendering or editing component as it will be set during rendering.

If the column index is valid but the row index is less than zero the method returns a rectangle with the y and height values set appropriately and the x and width values both set to zero. In general, when either the row or column indices indicate a cell outside the appropriate range, the method returns a rectangle depicting the closest edge of the closest cell that is within the table's range. When both row and column indices are out of range the returned rectangle covers the closest point of the closest cell.

In all cases, calculations that use this method to calculate results along one axis will not fail because of anomalies in calculations along the other axis. When the cell is not valid the includeSpacing parameter is ignored.

row

the row index where the desired cell is located

column

the column index where the desired cell is located in the display; this is not necessarily the same as the column index in the data model for the table; the this.convertColumnIndexToView(int) method may be used to convert a data model column index to a display column index

includeSpacing

if false, return the true cell bounds - computed by subtracting the intercell spacing from the height and widths of the column and row models

returns

the rectangle containing the cell at location row,column

function getColumn(identifier:Dynamic): TableColumn

Returns the TableColumn object for the column in the table whose identifier is equal to identifier, when compared using equals.

identifier

the identifier object

returns

the TableColumn object that matches the identifier

function getColumnAt(columnIndex:Int): TableColumn

Returns the TableColumn object for the column at columnIndex.

columnIndex

the index of the desired column

returns

the TableColumn object for the column at columnIndex

function getColumnClass(column:Int): String

Returns the type of the column appearing in the view at column position column.

column

the column in the view being queried

returns

the type of the column at position column in the view where the first column is column 0

function getColumnCount(): Int

Returns the number of columns in the column model. Note that this may be different from the number of columns in the table model.

returns

the number of columns in the table

See Also

function getColumnName(column:Int): String

Returns the name of the column appearing in the view at column position column.

column

the column in the view being queried

returns

the name of the column at position column in the view where the first column is column 0

function getDefaultCellFactory(columnClass:String): TableCellFactory

Returns the cell factory to be used when no factory has been set in a TableColumn. During the rendering of cells the factory is fetched from a Maptable of entries according to the class of the cells in the column. If there is no entry for this columnClass the method returns the entry for the most specific superclass. The JTable installs entries for "Object", "Number", and "Boolean", all of which can be modified or replaced.

columnClass

return the default cell factory for this columnClass

returns

the factory for this columnClass

See Also

function getDefaultEditor(columnClass:String): TableCellEditor

Returns the editor to be used when no editor has been set in a TableColumn. During the editing of cells the editor is fetched from a Maptable of entries according to the class of the cells in the column. If there is no entry for this columnClass the method returns the entry for the most specific superclass. The JTable installs entries for "Object", "Number", and "Boolean", all of which can be modified or replaced.

columnClass

return the default cell editor for this columnClass

returns

the default cell editor to be used for this columnClass

See Also

function getEditingColumn(): Int

Returns the index of the column that contains the cell currently being edited. If nothing is being edited, returns -1.

returns

the index of the column that contains the cell currently being edited; returns -1 if nothing being edited

See Also

function getEditingRow(): Int

Returns the index of the row that contains the cell currently being edited. If nothing is being edited, returns -1.

returns

the index of the row that contains the cell currently being edited; returns -1 if nothing being edited

See Also

function getHeaderHeight(): Int

Returns the header height.

function getLogicLocationFromPixelLocation(p:IntPoint): IntPoint

Returns the logic location in the JTable view area of the pixel location.

function getPixelLocationFromLogicLocation(p:IntPoint): IntPoint

Returns the location in the JTable view area of the logic location.

function getRowCount(): Int

Returns the number of rows in this table's model.

returns

the number of rows in this table's model

See Also

function getSelectedColumn(): Int

Returns the index of the first selected column, -1 if no column is selected.

returns

the index of the first selected column

function getSelectedColumnCount(): Int

Returns the number of selected columns.

returns

the number of selected columns, 0 if no columns are selected

function getSelectedColumns(): Array<Dynamic>

Returns the indices of all selected columns.

returns

an array of integers containing the indices of all selected columns, or an empty array if no column is selected

See Also

function getSelectedRow(): Int

Returns the index of the first selected row, -1 if no row is selected.

returns

the index of the first selected row

function getSelectedRowCount(): Int

Returns the number of selected rows.

returns

the number of selected rows, 0 if no rows are selected

function getSelectedRows(): Array<Dynamic>

Returns the indices of all selected rows.

returns

an array of integers containing the indices of all selected rows, or an empty array if no row is selected

See Also

function getSelectionBackground(): ASColor

Returns the background color for selected cells.

returns

the Color used for the background of selected list items

function getSelectionForeground(): ASColor

Returns the foreground color for selected cells.

returns

the Color object for the foreground property

function getValueAt(row:Int, column:Int): Dynamic

Returns the cell value at row and column.

Note: The column is specified in the table view's display order, and not in the `TableModel`'s column order. This is an important distinction because as the user rearranges the columns in the table, the column at a given index in the view will change.

Meanwhile the user's actions never affect the model's column ordering.

row

the row whose value is to be queried

column

the column whose value is to be queried

returns

the Object at the specified cell

function invalidateLayout(target:Container): Void

See Also

function isCellEditable(row:Int, column:Int): Bool

Returns true if the cell at row and column is editable. Otherwise, invoking this.setValueAt on the cell will have no effect.

Note: The column is specified in the table view's display order, and not in the `TableModel`'s column order. This is an important distinction because as the user rearranges the columns in the table, the column at a given index in the view will change.

Meanwhile the user's actions never affect the model's column ordering.

row

the row whose value is to be queried

column

the column whose value is to be queried

returns

true if the cell is editable

See Also

function isCellSelected(row:Int, column:Int): Bool

Returns true if the specified indices are in the valid range of rows and columns and the cell at the specified position is selected.

row

the row being queried

column

the column being queried

returns

true if row and column are valid indices and the cell at index (row, column) is selected, where the first row and first column are at index 0

function isColumnSelected(column:Int): Bool

Returns true if the specified index is in the valid range of columns, and the column at that index is selected.

column

the column in the column model

returns

true if column is a valid index and the column at that index is selected (where 0 is the first column)

function isEditing(): Bool

Returns true if a cell is being edited.

returns

true if the table is editing a cell

See Also

function isRowSelected(row:Int): Bool

Returns true if the specified index is in the valid range of rows, and the row at that index is selected.

returns

true if row is a valid index and the row at that index is selected (where 0 is the first row)

function moveColumn(column:Int, targetColumn:Int): Void

Moves the column column to the position currently occupied by the column targetColumn in the view. The old column at targetColumn is shifted left or right to make room.

column

the index of column to be moved

targetColumn

the new index of the column

function removeColumn(aColumn:TableColumn): Void

Removes aColumn from this JTable's array of columns. Note: this method does not remove the column of data from the model; it just removes the TableColumn that was responsible for displaying it.

@param aColumn the TableColumn to be removed @see #addColumn

function removeColumnSelectionInterval(index0:Int, index1:Int, ?programmatic:Bool = true): Void

Deselects the columns from index0 to index1, inclusive.

index0

one end of the interval

index1

the other end of the interval

programmatic

indicate if this is a programmatic change

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

Removes a listener from column selection changed listeners.

listener

the listener to be removed.

See Also

function removeEditor(): Void

function removeRowSelectionInterval(index0:Int, index1:Int, ?programmatic:Bool = true): Void

Deselects the rows from index0 to index1, inclusive.

index0

one end of the interval

index1

the other end of the interval

programmatic

indicate if this is a programmatic change

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

Removes a listener from row selection changed listeners.

listener

the listener to be removed.

See Also

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

Removes a state listener.

listener

the listener to be removed.

See Also

function rowAtPoint(point:IntPoint): Int

Returns the index of the row that point lies in, or -1 if the result is not in the range [0, `getRowCount()`-1].

point

the location of interest

returns

the index of the row that point lies in, or -1 if the result is not in the range [0, `getRowCount()`-1]

See Also

function scrollRectToVisible(contentRect:IntRectangle, ?programmatic:Bool = true): Void

function selectAll(?programmatic:Bool = true): Void

Selects all rows, columns, and cells in the table.

programmatic

indicate if this is a programmatic change

function setColumnSelectionInterval(index0:Int, index1:Int, ?programmatic:Bool = true): Void

Selects the columns from index0 to index1, inclusive.

index0

one end of the interval

index1

the other end of the interval

programmatic

indicate if this is a programmatic change

function setDefaultCellFactory(columnClass:String, renderer:TableCellFactory): Void

Sets a default cell factory to be used if no renderer has been set in a TableColumn. If renderer is null, removes the default factory for this column class.

columnClass

set the default cell factory for this columnClass

renderer

default cell factory to be used for this columnClass

See Also

function setDefaultEditor(columnClass:String, editor:TableCellEditor): Void

Sets a default cell editor to be used if no editor has been set in a TableColumn. If no editing is required in a table, or a particular column in a table, uses the isCellEditable method in the TableModel interface to ensure that this JTable will not start an editor in these columns. If editor is null, removes the default editor for this column class.

columnClass

set the default cell editor for this columnClass

editor

default cell editor to be used for this columnClass

function setEditingColumn(aColumn:Int): Void

function setEditingRow(aRow:Int): Void

function setRowSelectionInterval(index0:Int, index1:Int, ?programmatic:Bool = true): Void

Selects the rows from index0 to index1, inclusive.

index0

one end of the interval

index1

the other end of the interval

programmatic

indicate if this is a programmatic change

function setSelectionBackground(selectionBackground:ASColor): Void

Sets the background color for selected cells. Cell renderers can use this color to the fill selected cells.

The default value of this property is defined by the look and feel implementation.

selectionBackground

the Color to use for the background of selected cells

function setSelectionForeground(selectionForeground:ASColor): Void

Sets the foreground color for selected cells. Cell renderers can use this color to render text and graphics for selected cells.

The default value of this property is defined by the look and feel implementation.

selectionForeground

the Color to use in the foreground for selected list items

function setValueAt(aValue:Dynamic, row:Int, column:Int): Void

Sets the value for the cell in the table model at row and column.

Note: The column is specified in the table view's display order, and not in the `TableModel`'s column order. This is an important distinction because as the user rearranges the columns in the table, the column at a given index in the view will change. Meanwhile the user's actions never affect the model's column ordering.

aValue is the new value.

aValue

the new value

row

the row of the cell to be changed

column

the column of the cell to be changed

See Also