|
Generated by JDiff |
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | |||||||||
This file contains all the changes in documentation in the packagejavax.swing.tableas colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
This abstract class provides default implementations for most of the methods in theClass AbstractTableModel, void addTableModelListener(TableModelListener)TableModelinterface. It takes care of the management oflistnerslisteners and provides some conveniences for generatingTableModelEventsand dispatching them to the listeners. To create a concreteTableModelas a sublcass ofAbstractTableModelyou need only provide implementations for the following three methods:public int getRowCount(); public int getColumnCount(); public Object getValueAt(int row int column);Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
23 0828 02/2802/9800 @author Alan Chung @author Philip Milne
Class AbstractTableModel, int findColumn(String)AddAdds a listener to the list that's notified each time a change to the data model occurs. @param l the TableModelListener
Class AbstractTableModel, void fireTableCellUpdated(int, int)ConvenienceReturnsmethod foralocating columns bycolumn given its name. Implementation is naive so this should be overridden if this method is to be called often. This method is not in theTableModelinterface and is not used by theJTable. @param columnName string containing name of column to be located @return the column withcolumnNameor -1 if not found
Class AbstractTableModel, void fireTableChanged(TableModelEvent)NotifyNotifies all listeners that the value of the cell at([row columnhas been updated. @param row row of cell which has been updated @param column column of cell which has been updated @see TableModelEvent @see EventListenerList)]
Class AbstractTableModel, void fireTableDataChanged()ForwardForwards the given notification event to allTableModelListenersthat registered themselves as listeners for this table model. @param e the event to be forwarded @see #addTableModelListener @see TableModelEvent @see EventListenerList
Class AbstractTableModel, void fireTableRowsDeleted(int, int)NotifyNotifies all listeners that all cell values in the table's rows may have changed. The number of rows may also have changed and theJTableshould redraw the table from scratch. The structure of the tableie.(as in the order of the columns) is assumed to be the same. @see TableModelEvent @see EventListenerList
Class AbstractTableModel, void fireTableRowsInserted(int, int)NotifyNotifies all listeners that rows in the(inclusive)range[firstRow lastRow]inclusive have been deleted. @param firstRow the first row @param lastRow the last row @see TableModelEvent @see EventListenerList
Class AbstractTableModel, void fireTableRowsUpdated(int, int)NotifyNotifies all listeners that rows in the(inclusive)range[firstRow lastRow]inclusive have been inserted. @param firstRow the first row @param lastRow the last row @see TableModelEvent @see EventListenerList
Class AbstractTableModel, void fireTableStructureChanged()NotifyNotifies all listeners that rows in the(inclusive)range[firstRow lastRow]inclusive have been updated. @param firstRow the first row @param lastRow the last row @see TableModelEvent @see EventListenerList
Class AbstractTableModel, Class getColumnClass(int)NotifyNotifies all listeners that the table's structure has changed. The number of columns in the table and the names and types of the new columns may be different from the previous state. If theJTablerecievesreceives this event and itsautoCreateColumnsFromModelflag is set it discards anyTableColumnstable columns that it had and reallocates defaultonescolumns in the order they appear in the model. This is the same as callingsetModel(TableModel)on theJTable. @see TableModelEvent @see EventListenerList
ReturnsClass AbstractTableModel, String getColumnName(int)Object.classbyregardlessdefaultofcolumnIndex. @param columnIndex the column being queried @return the Object.class
Class AbstractTableModel, boolean isCellEditable(int, int)ReturnReturns a default name for the column using spreadsheet conventions: A B C ... Z AA AB etc. Ifcolumncannot be found returns an empty string. @param column the column being queried @return a string containing the default name ofcolumn
Returns false. ThisClass AbstractTableModel, void removeTableModelListener(TableModelListener)default implementation returns falseis the default implementation for all cells. @param rowIndex the row being queried @param columnIndex the column being queried @return false
Class AbstractTableModel, void setValueAt(Object, int, int)RemoveRemoves a listener from the list that's notified each time a change to the data model occurs. @param l the TableModelListener
This empty implementation is provided so users don't have to implement this method if their data model is not editable. @param aValue value to assign to cell @param rowIndex row of cell @param columnIndex column of cell
The standard class for rendering (displaying) individual cells in aJTable.Implementation Note: This class inherits from
JLabela standard component class. HoweverJTableemploys a unique mechanism for rendering its cells and therefore requires some slightly modified behavior from its cell renderer. The table class defines a single cell renderer and uses it as a as a rubber-stamp for rendering all cells in the table; it renders the first cell changes the contents of that cell renderer shifts the origin to the new location re-draws it and so on. The standardJLabelcomponent was not designed to be used this way and we want to avoid triggering arevalidateeach time the cell is drawn. This would greatly decrease performance because therevalidatemessage would be passed up the hierarchy of the container to determine whether any other components would be affected. So this class overrides thevalidaterevalidaterepaintandfirePropertyChangemethods to be no-ops. If you write your own renderer please keep this performance consideration in mind.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
15 0925 02/0102/9800 @author Philip Milne @see JTable
A subclass ofDefaultTableCellRendererthat implementsUIResource.DefaultTableCellRendererdoesn't implementUIResourcedirectly so that applications can safely override thecellRendererproperty withDefaultTableCellRenderersubclasses.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.
Class DefaultTableCellRenderer, void setBackground(Color)SupportOverridden fordeferredperformanceautomatic layout. Calls invalidate() and then adds this components validateRoot to a list of components that need to be validated. Validation will occur after all currently pending events have been dispatched. In other words after this method is called the first validateRoot (if any) found when walking up the containment hierarchy of this component will be validated. By default JRootPane JScrollPane and JTextField return true from isValidateRoot(). This method will automatically be called on this component when a property value changes such that size location or internal layout of this component has been affectedreasons.ThisSeeautomatic updating differs from the AWT because programs generally no longer need to invoke validate() to get the contents oftheGUI to update.Implementation@seeNotejava.awt.Component#invalidatefor@seemorejava.awtinformation.Container#validate @see #isValidateRoot @see RepaintManager#addInvalidComponent
OverridesClass DefaultTableCellRenderer, void setForeground(Color)JComponent.setForegroundtospecifyassign the unselected-background colorusingto the specified color. @param c set the background color to this value
OverridesClass DefaultTableCellRenderer, void updateUI()JComponent.setForegroundtospecifyassign the unselected-foreground colorusingto the specified color. @param c set the foreground color to this value
Notification from theClass DefaultTableCellRenderer, void validate()UIManagerthat the look and feel [L&F] has changed. Replaces the current UI object with the latest version from theUIManager. @see JComponent#updateUI
Validates this containerOverridden for performanceand all of its subcomponentsreasons.AWT uses validate to cause a container to laySeeout its subcomponents again afterthecomponents it containsImplementationhaveNotebeen addedfor moreto or modifiedinformation.@see #validate @see Component#invalidate
The standard column-handler for aClass DefaultTableColumnModel, void addColumn(TableColumn)JTable.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
26 1035 02/2102/9800 @author Alan Chung @author Philip Milne @see JTable
AppendsClass DefaultTableColumnModel, TableColumn getColumn(int)aColumnto the end of thereceiver'stableColumnsarray. This method also posts thecolumnAddedevent to its listeners. @param column()ThetheTableColumn to be added @exception IllegalArgumentException ifaColumnisnull@see #removeColumn
Returns theClass DefaultTableColumnModel, int getColumnCount()TableColumnobject for the column atcolumnIndex. @return the TableColumn object forparam columnIndex the index of the columnat columnIndexdesired @param columnIndexreturn theindexTableColumnofobject for the columndesiredatcolumnIndex
Returns the number of columns in theClass DefaultTableColumnModel, int getColumnIndex(Object)receiver'stableColumnstable columnsarray. @return the number of columns in thereceiver's table columnstableColumnsarray @see #getColumns
Returns the index of the first column in theClass DefaultTableColumnModel, int getColumnIndexAtX(int)receiver's columnstableColumnsarray whose identifier is equal toidentifierwhen compared usingequals. @param identifier the identifier object @return the index of the first()tablecolumn in thereceiver'stableColumnsarray whose identifier is equal toidentifier when compared using equals(). @param identifier theidentifierobject@exception IllegalArgumentException ifidentifierisnullor if noTableColumnhas thisidentifier@see #getColumn
Returns the index of the column that liesClass DefaultTableColumnModel, int getColumnMargin()on theat positionxPositionxor -1 ifit lies outside theno column covers thisanypoint.of@param x thecolumn'shorizontalbounds.location of interest @return the index of the column or -1 if no column is found
Returns the width margin forClass DefaultTableColumnModel, Enumeration getColumns()TableColumn. The defaultcolumnMarginis 1. @return the maximum width for theTableColumn@see #setColumnMargin.
Returns anClass DefaultTableColumnModel, ListSelectionModel getSelectionModel()Enumerationof all the columns in the model. @return anEnumerationof the columns in the model
Returns theClass DefaultTableColumnModel, void moveColumn(int, int)ListSelectionModelthat is used to maintain column selection state. @return the object that provides column selection state. Ornullif row selection is not allowed. @see #setSelectionModel()
Moves the column and heading atClass DefaultTableColumnModel, void removeColumn(TableColumn)columnIndextonewIndex. The old column atcolumnIndexwill now be found atnewIndex. The column that used to be atnewIndexis shifted left or right to make room. This will not move any columns ifcolumnIndexequalsnewIndex. This method also poststheacolumnMovedevent to its listeners. @param columnIndex the index of column to be moved @param newIndex()Newnew index to move the column @exception IllegalArgumentException ifcolumnornewIndexare not in the valid range
Deletes theClass DefaultTableColumnModel, void setColumnMargin(int)TableColumncolumnfrom thereceiver's table columnstableColumnsarray. This method will do nothing ifcolumnis not in the table's columns list.tileis called to resize both the header and table views. This method also posts()theacolumnRemovedevent to its listeners. @param column()ThetheTableColumn to be removed @see #addColumn
Sets the column margin toClass DefaultTableColumnModel, void setSelectionModel(ListSelectionModel)newMargin. This method also poststheacolumnMarginChangedevent to its listeners. @param newMargin the()widthnew marginofwidththe columnin pixels @see #getColumnMargin @see #getTotalColumnWidth
Sets the selection model for thisTableColumnModeltonewModeland registerswithforlistnerlistener notifications from the new selection model. IfnewModelisnullit meanscolumns are not selectablean exception is thrown. @param newModel the new selection model @exception IllegalArgumentException ifnewModelisnull@see #getSelectionModel
This is an implementation ofClass DefaultTableModel, constructor DefaultTableModel()TableModelthat uses aVectorofVectorsto store the cell value objects.
Note: The DefaultTableModel's API contains the methods addColumn() removeColumn() but not methods to insert a column at an index nor methods to move the columns. This is because JTable does not display the columns based on the order of the columns in this model. So rearranging them here doesn't do much. See the column ordering methods in TableColumnModel.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.19 0827 02/2802/9800 @author Alan Chung @author Philip Milne @see TableModel @see #getDataVector
Constructs a default DefaultTableModel which is a table of zero columns and zero rows.
Class DefaultTableModel, constructor DefaultTableModel(Object[], int)Constructs aClass DefaultTableModel, constructor DefaultTableModel(Object[][], Object[])DefaultTableModelwith as many columns as there are elements incolumnNamesandnumRowsofnullobject values. Each column's name will be taken from thecolumnNamesarray. @param columnNamesArrayarraycontaining the names of the new columns. If this isnull then the model has no columns @param numRowsThethe number of rows the table holds @see #setDataVector @see #setValueAt
Constructs aClass DefaultTableModel, constructor DefaultTableModel(Vector, Vector)DefaultTableModeland initializes the table by passingdataandcolumnNamesto thesetDataVectormethod. The first index in the()Object[][]array is the row index and the second is the column index. @param dataThethe data of the table @param columnNamesThethe names of the columns.@see #getDataVector @see #setDataVector
Constructs aClass DefaultTableModel, constructor DefaultTableModel(Vector, int)DefaultTableModeland initializes the table by passingdataandcolumnNamesto thesetDataVectormethod. @param data()Thethe data of the table @param columnNamesVectorvectorcontaining the names of the new columns.@see #getDataVector @see #setDataVector
Constructs aClass DefaultTableModel, constructor DefaultTableModel(int, int)DefaultTableModelwith as many columns as there are elements incolumnNamesandnumRowsofnullobject values. Each column's name will be taken from thecolumnNamesvector. @param columnNamesVectorvectorcontaining the names of the new columns. If this isnull then the model has no columns @param numRowsThethe number of rows the table holds @see #setDataVector @see #setValueAt
Constructs aClass DefaultTableModel, void addColumn(Object)DefaultTableModelwithnumRowsandnumColumnsofnullobject values. @param numRowsThethe number of rows the table holds @param numColumnsThethe number of columns the table holds @see #setValueAt
Class DefaultTableModel, void addColumn(Object, Object[])AddAdds a column to the model. The new column will have theidenitifieridentifiercolumnName. This method will send atableChangednotification message to all the listeners. This method is a cover for()addColumn(Object Vector)which usesnullas the data vector. @param columnName the identifier of the column being added @exception IllegalArgumentException ifcolumnNameisnull
Adds a column to the model.Class DefaultTableModel, void addColumn(Object, Vector)withThe new columnnamewill have the identifiercolumnName.columnDatais the optional array of data for the column. If it isnullthe column is filled withnullvalues. Otherwise the new data will be added to model starting with the first element going to row 0 etc. This method will send atableChangednotification message to all the listeners. @see #addColumn(Object Vector)
Class DefaultTableModel, void addRow(Object[])AddAdds a column to the model. The new column will have theidenitifieridentifiercolumnName.columnDatais the optionalVectorvector of data for the column. If it isnullthe column is filled withnullvalues. Otherwise the new data will be added to model starting with the first element going to row 0 etc. This method will send atableChangednotification message to all the listeners. @param columnName the identifier of the column being added @param columnData optional data of the column being added @exception IllegalArgumentException if()columnNameisnull
Class DefaultTableModel, void addRow(Vector)AddAdds a row to the end of the model. The new row will containnullvalues unlessrowDatais specified. Notification of the row being added will be generated. @param rowData optional data of the row being added
Class DefaultTableModel, Vector convertToVector(Object[])AddAdds a row to the end of the model. The new row will containnullvalues unlessrowDatais specified. Notification of the row being added will be generated. @param rowData optional data of the row being added
Returns aClass DefaultTableModel, Vector convertToVector(Object[][])Vectorvector that contains the same objects as the array. @param anArray the array to be converted @return the new vector; ifanArrayisnullreturnsnull
Returns aClass DefaultTableModel, String getColumnName(int)Vectorvector ofVectorsvectors that contains the same objects as the array. @param anArray the double array to be converted @return the new vector of vectors; ifanArrayisnullreturnsnull
Returns the column name. @return a name for this column using the string value of the appropriate member inClass DefaultTableModel, Vector getDataVector()columnIdentfierscolumnIdentifiers. IfcolumnIdentfierscolumnIdentifiersisnullor does not haveandan entry for this indexreturnreturns the default name provided by the superclass.
Class DefaultTableModel, Object getValueAt(int, int)ThisReturnsreturnstheVectorofVectorsthat contains the table's data values. The vectors contained in the outer vector are each a single row of values. In other words to get to the cell at row 1 column 5:
((Vector)getDataVector().elementAt(1)).elementAt(5);
You can directly alter the returned Vector. You can change the cell values the number of rows. If you need to alter@return thenumbervector ofcolumns in the model you can do so with addColumn() removeColumn() or the setDataVector() methods. Once you have finished modifying the dataVector you must inform the modelvectorsofcontaining thenewtables datausing one of the notification methods. The notification methods will generate the appropriate TableModelListener messages to notify the JTable and any other listeners of this model.values @see #newDataAvailable @see #newRowsAdded @see #setDataVector
Returns an attribute value for the cell atClass DefaultTableModel, void insertRow(int, Object[])rowandcolumn. @param row the row whose value is to belookedqueriedup@param column the column whose value is to belooked upqueried @return the value Object at the specified cell @exception ArrayIndexOutOfBoundsException if an invalid row or column was given.
Class DefaultTableModel, void insertRow(int, Vector)InsertInserts a row atrowin the model. The new row will containnullvalues unlessrowDatais specified. Notification of the row being added will be generated. @param row the row index of the row to be inserted @param rowData optional data of the row being added @exception ArrayIndexOutOfBoundsException if the row was invalid.
Class DefaultTableModel, boolean isCellEditable(int, int)InsertInserts a row atrowin the model. The new row will containnullvalues unlessrowDatais specified. Notification of the row being added will be generated. @param row the row index of the row to be inserted @param rowData optional data of the row being added @exception ArrayIndexOutOfBoundsException if the row was invalid.
Returns trueClass DefaultTableModel, void moveRow(int, int, int)ifregardlessthe cell at row and column is editable. Otherwise the setValueAt() on the cell will not change the valueofthat cellparameter values. @param row the row whose value is to belooked upqueried @param column the column whose value is to belookedqueriedup@return trueif the cell is editable.@see #setValueAt
Moves one or more rows starting atClass DefaultTableModel, void newDataAvailable(TableModelEvent)startIndextoendIndexin the model to thetoIndex. This method will send atableChangednotification message to all the listeners.()
Examples of moves:@param startIndex the starting row index to be moved @param endIndex the ending row index to be moved @param toIndex the destination of the rows to be moved @exception ArrayIndexOutOfBoundsException if any of the indices are out of range1. moveRow(1 3 5);
a|B|C|D|e|f|g|h|i|j|k - before a|e|f|B|C|D|g|h|i|j|k - after
2. moveRow(6 7 1);
a|b|c|d|e|f|G|H|i|j|k - before a|G|H|b|c|d|e|f|i|j|k - after
. Or; or ifendIndexis less thanstartIndex.
Equivalent to fireTableChanged. @param event the change event
Class DefaultTableModel, void newRowsAdded(TableModelEvent)Class DefaultTableModel, void removeRow(int)This method will makeEnsuressurethat the new rows have the correct number of columns.ItThis isdoes soaccomplished by using thesetSizemethod inVectorwhich truncatesVectorsvectors which are too long and appendsnullsnulls if they are too short. This method also sends out atableChangednotification message to all the listeners. @()parameterparam eventThisthisTableModelEventdescribes where the rows were added. Ifnullit assumes all the rows were newly added.@see #getDataVector
Class DefaultTableModel, void rowsRemoved(TableModelEvent)RemoveRemoves the row atrowfrom the model. Notification of the row being removed will be sent to all the listeners. @param row the row index of the row to be removed @exception ArrayIndexOutOfBoundsException if the row was invalid.
Equivalent to fireTableChanged(). @param event the change event
Class DefaultTableModel, void setColumnIdentifiers(Object[])Replaces the column identifiers in the model. If the number ofClass DefaultTableModel, void setColumnIdentifiers(Vector)newIdentifiersnewIdentifiers is greater than the currentnumColumnsnumber of columns new columns are added to the end of each row in the model. If the number ofnewIdentifiers is less than the current number of columns all the extra columns at the end of a row are discarded.@param newIdentifiers
Arrayarray of column identifiers.AIfnullmeanssettingset the model to zero columns @see #setNumRows
Replaces the column identifiers in the model. If the number ofClass DefaultTableModel, void setDataVector(Object[][], Object[])newIdentifiers is greater than the current number of columns new columns are added to the end of each row in the model. If the number ofnewIdentifiers is less than the current number of columns all the extra columns at the end of a row are discarded.@param newIdentifiers
Vectorvector of column identifiers.AIfnullmeanssettingset the model to zero columns @see #setNumRows
Class DefaultTableModel, void setDataVector(Vector, Vector)ThisReplacesreplacesthe value in thedataVectorinstance variable with the values in the arraynewData. The first index in theObject[][]array is the row index and the second is the column index.columnNamesare the names of the new columns. @param newData the new data vector @param columnNames the names of the columns @see #setDataVector(Vector Vector)
Class DefaultTableModel, void setNumRows(int)ThisReplacesreplacesthe currentdataVectorinstance variable with the new Vector of rowsnewData.columnNamesare the names of the new columns. The first name incolumnNamesis mapped to column 0 innewData. Each row innewDatais adjusted to match the number of columns incolumnNameseither by truncating theVectorif it is too long or addingnullvalues if it is too short.@param newData
Thethe new data vector @param columnNamesThethe names of the columns @see #newDataAvailable @see #getDataVector
Class DefaultTableModel, void setValueAt(Object, int, int)Sets theObsolete asnumberofrows in the modelJava 2 platform v1.If the new size is greater than the current size new rows are added to the end of the model If the new size is less than the current size all rows at index newSize and greater are discarded3.@param newSizePleasetheusenewsetRowCountnumber of rows @see #setColumnIdentifiersinstead.
Sets the object value for the cell atClass DefaultTableModel, Vector columnIdentifierscolumnandrow.aValueis the new value. This method will generate atableChangednotification. @param aValue the new value(). This; this can be null.@param row the row whose value is to be changed @param column the column whose value is to be changed @exception ArrayIndexOutOfBoundsException if an invalid row or column was given.
The Vector of column identifiers.
Class DefaultTableModel, Vector dataVectorTheVectorofVectorVectorsofObjectvalues.
This is thecolumnobjectheader part of a JTable. Iwhichallowmanages theuser to change column widths and column ordering. Iheadershareof thesame TableColumnModel with aJTable.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
36 1054 03/0815/9800 @author Alan Chung @author Philip Milne @see javax.swing.JTable
TheThis classusedimplementstoaccessibility supportobtainfor theaccessibleJTableHeaderclass. Itrole forprovides anthisimplementation of the Java Accessibility API appropriate to table header user-interfaceobjectelements.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.
Get the AccessibleContext associated with this@returnobject. In theAccessibleContextimplementation of the Java Accessibility API for this class returns this object which serves as its own AccessibleContext. @return thisJComponentobject
Constructs aClass JTableHeader, constructor JTableHeader(TableColumnModel)JTableHeaderwith a defaultTableColumnModel. @see #createDefaultColumnModel()
Constructs aClass JTableHeader, int columnAtPoint(Point)JTableHeaderwhich is initialized withcmas the column model. Ifcmisnullthis method will initialize the table header with a defaultTableColumnModel. @param cmThethe column model for the table @see #createDefaultColumnModel()
Returns the index of the column thatClass JTableHeader, TableColumnModel createDefaultColumnModel()pointlies in or -1 if it liesoutsideoutthe receiver'sof bounds. @return the index of the column thatpointlies in or -1 if it liesoutsideoutthe receiver'sof bounds
Returns the default column model object which is aClass JTableHeader, AccessibleContext getAccessibleContext()DefaultTableColumnModel.SubclassA subclass can override this method to return a different column model object @return the default column model object
Class JTableHeader, TableColumnModel getColumnModel()GetGets the AccessibleContext associated with thisJComponentJTableHeader. For JTableHeaders the AccessibleContext takes the form of an AccessibleJTableHeader. A new AccessibleJTableHeader instance is created if necessary. @return an AccessibleJTableHeader that serves as the AccessibleContext of thisJComponentJTableHeader
Returns theClass JTableHeader, TableColumn getDraggedColumn()TableColumnModelthat contains all columninforamtioninformation of this table header. @return theobjectcolumnModelthat provides the column state of the tableproperty @see #setColumnModel()
Returns the the dragged column if and only if a drag is in process otherwise returnsClass JTableHeader, int getDraggedDistance()null. @return thethedragged column ifand only ifa drag is in process otherwise returnsnull@see #getDraggedDistance.
Returns the column's horizontal distance from its original position if and only if a drag is in process. Otherwise the the return value is meaningless. @return the column's horizontal distance from its original position ifClass JTableHeader, Rectangle getHeaderRect(int)and only ifa drag is in process otherwise the return value is meaningless @see #getDraggedColumn
Returns the rectangle containing the header tile atClass JTableHeader, boolean getReorderingAllowed()columnIndexcolumn. When thecolumnparameter is out of bounds this method uses the same conventions as theJTablemethodgetCellRect. @return the rectangle containing the header tile atcolumnIndexcolumn@exception IllegalArgumentException If columnIndex is out ofseerangeJTable#getCellRect
Returns true if theClass JTableHeader, boolean getResizingAllowed()receiver allowsuserthe useris allowed to rearrange columns by dragging their headers false otherwise. The default is true. You can rearrange columns programmatically regardless of this setting. @returntrue if the receiver allowstheuser to rearrange columns by dragging their headers falsereorderingAllowedotherwiseproperty @see #setReorderingAllowed
Returns true if theClass JTableHeader, TableColumn getResizingColumn()receiver allowsuserthe useris allowed to resize columns by dragging between their headers false otherwise. The default is true. You can resize columns programmatically regardless of this setting. @returntrue ifthereceiver allows the user to resize columns by dragging betweenresizingAllowedtheir headers false otherwise.property @see #setResizingAllowed
Returns the resizing column. If no column is being resized this method returns null. @return the resizing column
Class JTableHeader, JTable getTable()Returns the table associated with this headerClass JTableHeader, String getToolTipText(MouseEvent)'s. @returnpartnerthetableproperty
Class JTableHeader, TableHeaderUI getUI()OverridingAllowsto allowthe renderer's tips to be used ifit hasthere is text set. @param event the location of the event identifies the proper renderer and therefore the proper tip @return the tool tip for this component
Returns the look and feel (L&F) object that renders this component. @return the TableHeaderUI object that renders this component
Class JTableHeader, String getUIClassID()Returns the suffix used to construct the name of the look and feel (L&F) classClass JTableHeader, boolean getUpdateTableInRealTime()thatused torendersrender this component. @return the string "TableHeaderUI" @return "TableHeaderUI" @see JComponent#getUIClassID @see UIDefaults#getUI
Class JTableHeader, String paramString()Returns trueObsolete asif the receiver updates the bodyofthe table view in real time when a column isJavaresized or dragged2 platform v1.User can set this flag to false to3.speed up theReal time repaintstable'sin response touser resizecolumn dragging ordrag actions. Theresizingdefault is trueare now unconditional.@return true if the table updates in real time @see #setUpdateTableInRealTime
Returns a string representation of thisClass JTableHeader, void resizeAndRepaint()JTableHeader. This method is intended to be used only for debugging purposes and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull.Overriding
paramStringto provide information about the specific new aspects of the JFC components. @return a string representation of this()JTableHeader.
Class JTableHeader, void setColumnModel(TableColumnModel)ProperlySizessizesthereceiver and itsheaderviewand marks it as needing display.Also resets cursor rectangles forEquivalentthe header view and linetoscrollrevalidateamountsfollowedfor thebyJScrollPanerepaint.
Sets the column model for this table toClass JTableHeader, void setDraggedColumn(TableColumn)newModeland registerswithforlistnerlistener notifications from the new column model. @paramnewModelcolumnModel the new data source for this table @exception IllegalArgumentException ifnewModelisnull@see #getColumnModel()@beaninfo bound: true description: The object governing the way columns appear in the view.
Sets the header'sClass JTableHeader, void setDraggedDistance(int)draggedColumntoaColumn@param aColumn the new value for draggedColumn
Sets the header'sClass JTableHeader, void setReorderingAllowed(boolean)draggedDistancetodistance. @param distance the distance dragged
Sets whether the user can drag column headers to reorder columns. @paramClass JTableHeader, void setResizingAllowed(boolean)flagreorderingAllowed true if the table view should allow reordering; otherwise false @see #getReorderingAllowed @beaninfo bound: true description: Whether the user can drag column headers to reorder columns.
Sets whether the user can resize columns by dragging between headers. @paramClass JTableHeader, void setResizingColumn(TableColumn)flagresizingAllowed true if table view should allow resizing @see #getResizingAllowed @beaninfo bound: true description: Whether the user can resize columns by dragging between headers.
Sets the header'sClass JTableHeader, void setTable(JTable)resizingColumntoaColumn. @param aColumn the column being resized
Sets the table associated with this headerClass JTableHeader, void setUI(TableHeaderUI)'s. @param table thepartnernew tableto@beaninfoaTablebound: true description: The table associated with this header.
Sets the look and feel (L&F) object that renders this component. @param ui the TableHeaderUI L&F object @see UIDefaults#getUI
Class JTableHeader, void setUpdateTableInRealTime(boolean)Class JTableHeader, void updateUI()Sets whetherObsolete asthe bodyofthe table updates in real time when a column isJavaresized or dragged2 platform v1.@param flag true if3.tableView should update the body of the table in real timeReal time repaints in response to column dragging or resizing are@seenow#getUpdateTableInRealTimeunconditional.
Notification from theClass JTableHeader, TableColumnModel columnModelUIManagerthat the look and feel (L&F) has changed. Replaces the current UI object with the latest version from theUIManager. @see JComponent#updateUI
The TableColumnModel of the table header.
Class JTableHeader, TableColumn draggedColumnThe index of the column being dragged.Class JTableHeader, int draggedDistance0nullif not dragging.
The distance from its original position the column has been dragged.Class JTableHeader, boolean reorderingAllowed
Class JTableHeader, boolean resizingAllowedReorderingIf true reordering of columns are allowed by the user; the default is true.
Class JTableHeader, TableColumn resizingColumnResizingIf true resizing of columns are allowed by the user; the default is true.
The index of the column being resized.Class JTableHeader, boolean updateTableInRealTime0nullif not resizing.
IfObsoletethis flagasis true then theof Java 2 platformheaderv1.3.will repaint the table as aReal time repaints in response to columnisdraggingdraggedorresizedresizing are now unconditional.
This interface defines theClass TableCellEditor, Component getTableCellEditorComponent(JTable, Object, boolean, int, int)methodsmethod any object that would like to be an editor of values for components such asListBoxJListBoxJComboBoxJTreeComboBoxorTreeJTableor Table etcneeds to implement. @version 1.10130802/2602/9800 @author Alan Chung
Sets an initialvaluefor the editor. This will cause the editor tostopEditingand lose any partially edited value if the editor is editing when this method is called.Returns the component that should be added to the client's
Componenthierarchy. Once installed in the client's hierarchy this component will then be able to draw and receive user input. @param table theJTablethat is asking the editor to edit;This parametercan benull@param value the value of the cell to be edited..;Itit is up to the specific editor to interpret and draw the value.eg.For example if value is theStringstring "true" it could be rendered as a string or it could be rendered as a check box that is checked.nullis a valid value.@param isSelected trueisif the cell is to berendererrendered withselectionhighlighting @param row the row of the cell being edited @param column the column of the cell being edited @return the component for editing
This interface defines theClass TableCellRenderer, Component getTableCellRendererComponent(JTable, Object, boolean, boolean, int, int)methodsmethod required by any object that would like to be a renderer forcellcells in aJTable. @version 1.11 0815 02/2602/9800 @author Alan Chung
This method is sent toReturns the component used for drawing therenderercell.by the drawing tableThis method is used to configure the renderer appropriately before drawing.Return the Component used for drawing.@param table theJTablethat is asking the renderer to draw. This;parametercan benull@param value the value of the cell to be rendered. It is up to the specific renderer to interpret and draw the value..eg.For example ifvalueis theStringstring "true" it could be rendered as a string or it could be rendered as a check box that is checked.nullis a valid value.@param isSelected trueisif the cell is to berendererrendered with the selectionhighlightinghighlighted; otherwise false @param hasFocus if true render cell appropriately. For example put a special border on the cell if the cell can be edited render in the color used to indicate editing @param row the row index of the cell being drawn. When drawing the header therowIndexvalue ofrowis -1.@param column the column index of the cell being drawn
AClass TableColumn, constructor TableColumn()TableColumnrepresents all the attributes of a column in aJTablesuch as width resizibility minimum and maximum width. In addition theTableColumnprovides 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
setDefaultRenderermethod in the(Class)JTableclass. This default mechanism is only used when the renderer (or editor) in theTableColumnisnull.The
TableColumnstores the link between the columns in theJTableand the columns in theTableModel.This theThemodelIndexis the column in theTableModelwhich will be queried for the data values for the cells in this column. As the column moves around in the view thismodelIndexdoes not change.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence. @version 1.
34 1049 02/2102/9800 @author Alan Chung @author Philip Milne @see javax.swing.table.TableColumnModel @see javax.swing.table.DefaultTableColumnModel @see javax.swing.table.JTableHeader#getDefaultRenderer() @see JTable#getDefaultRenderer(Class) @see JTable#getDefaultEditor(Class) @see JTable#getCellRenderer(int int) @see JTable#getCellEditor(int int)
Cover method using a default model index of 0 default width of 75 aClass TableColumn, constructor TableColumn(int)nullrenderer and anulleditor. Thismethodsmethod is intended for serialization. @see #TableColumn(int int TableCellRenderer TableCellEditor)
Cover method using a default width of 75 aClass TableColumn, constructor TableColumn(int, int)nullrenderer and anulleditor. @see #TableColumn(int int TableCellRenderer TableCellEditor)
Cover method using aClass TableColumn, constructor TableColumn(int, int, TableCellRenderer, TableCellEditor)nullrenderer and anulleditor. @see #TableColumn(int int TableCellRenderer TableCellEditor)
Creates and initializes an instance ofClass TableColumn, void addPropertyChangeListener(PropertyChangeListener)TableColumnwithmodelIndex. AllTableColumnconstructors delegate to this one. ThemodelIndexis the index of the column in the model which will supply the data for this column in the table. ThemodelIndexdoes not change as the columns are reordered in the view. The width parameter is used to set both thepreferredWidthfor this column and theintialinitial width. The renderer and editor are the objects usedrepsectivelyrespectively to render and edit values in this column. When these arenulldefault values provided by thegetDefaultRendererand(Class)getDefaultEditormethods in the(Class)JTableclass are used to provide defaults based on the type of the data in this column. This column-centric rendering strategy can be circumvented by overriding thegetCellRenderermethods in the()JTable.@
param modelIndex the column in the model which provides the values for this column @see JTable#getDefaultRenderer(Class) @see JTable#getDefaultEditor(Class) @see JTable#getCellRenderer(int int) @see JTable#getCellEditor(int int)
Class TableColumn, void disableResizedPosting()AddAdds aPropertyChangeListenerto the listener list. The listener is registered for all properties.A
PropertyChangeEventwill get fired in response to an explicit call tosetFontsetBackgroundorSetForegroundsetForegroundon the current component. Note that if the current component is inheriting its foreground background or font from its container then no event will be fired in response to a change in the inherited property. @param listenerThe PropertyChangeListenerthe listener to be added
Class TableColumn, void enableResizedPosting()Turns offThis fieldlistener-notificationswaswould otherwise occur when a column isnot used in previous releases and thereresizedare currently no plans to support it in the future. @deprecated as of Java 2 platform v1.3
Class TableColumn, TableCellEditor getCellEditor()Turns onThis fieldlistener-notificationswasso that listenersnot used in previous releases and there areoncecurrently no plans to support it in the future.again@deprecatedinformed when a column is resizedas of Java 2 platform v1.3
Returns theClass TableColumn, TableCellRenderer getCellRenderer()TableCellEditorused by theJTabletodrawedit values for this column.The cellEditor of the column not only controls the visual look for the column but is also used to interpret the value object supplied by the TableModel.When thecellEditorisnulltheJTableuses a default editor based on the class of the cells in that column. The default value for acellEditorisnull. @return theTableCellEditor used by the JTable to draw values for thiscellEditorcolumnproperty @see #setCellEditor @see JTable#setDefaultEditor
Returns theClass TableColumn, TableCellRenderer getHeaderRenderer()TableCellRendererused by theJTableto draw values for this column. ThecellRendererof the column not only controls the visual look for the column but is also used to interpret the value object supplied by theTableModel. When thecellRendererisnulltheJTableuses a default renderer based on the class of the cells in that column. The default value for acellRendererisnull. @return theTableCellRenderer used by the JTable to draw values for thiscellRenderercolumnproperty @see #setCellRenderer @see JTable#setDefaultRenderer
Returns theClass TableColumn, Object getHeaderValue()TableCellRendererused to draw the header of theTableColumn.The defaultWhenheadertherendererheaderRendererisanullJCellRenderertheinitializedJTableHeaderwith auses itsJLabeldefaultRenderer.@returnThethedefaultTableCellRenderervalueused tofor adrawheaderRendererisnull. @return theheaderheaderRendererproperty @see #setHeaderRenderer @see #setHeaderValue @see javax.swing.table.JTableHeader#getDefaultRenderer()
Returns theClass TableColumn, Object getIdentifier()Objectused as the value for the header renderer. @return theObject used as the value for the headerheaderValuerendererproperty @see #setHeaderValue
Returns theClass TableColumn, int getMaxWidth()identifierobject for this column. Note identifiers are not used bytheJTablethey are purely a convenience for external use. If theidentifierisnullgetIdentifier()returnsgetHeaderValueas a default. @return the()idenitifer object for thisidentifiercolumnproperty @see #setIdentifier
Returns the maximum width for theClass TableColumn, int getMinWidth()TableColumn. TheTableColumn's width can't be made larger than this either by the user or programmatically. The default maxWidth is Integer.MAX_VALUE. @return themaximum width for themaxWidthTableColumn.property @see #setMaxWidth
Returns the minimum width for theClass TableColumn, int getModelIndex()TableColumn. TheTableColumn's width can't be made less than this either by the user or programmatically. The default minWidth is 15. @return theminimum width for theminWidthTableColumnproperty @see #setMinWidth
Class TableColumn, int getPreferredWidth()GetsReturns the model index for this column. @return themodelIndexproperty
Returns the preferred width of theClass TableColumn, boolean getResizable()TableColumn. The default preferred width is 75. @return thewidth ofpreferredWidththe TableColumnproperty @see #setPreferredWidth
Returns true if the user is allowed to resize theClass TableColumn, int getWidth()TableColumn's width false otherwise. You can change the width programmatically regardless of this setting. The default is true. @returntrue if the user is allowed to resizetheTableColumn width falseisResizableotherwise.property @see #setResizable
Returns the width of theClass TableColumn, void removePropertyChangeListener(PropertyChangeListener)TableColumn. The default width is 75. @return thewidthof the TableColumnproperty @see #setWidth
Class TableColumn, void setCellEditor(TableCellEditor)RemoveRemoves aPropertyChangeListenerfrom the listener list.ThisTheremovesPropertyChangeListenera PropertyChangeListener thatto be removed was registered for all properties. @param listenerThethePropertyChangeListenerlistener to be removed
Sets theClass TableColumn, void setCellRenderer(TableCellRenderer)TableCellEditoreditor to used byJTable to drawwhenindividual values fora cell in this columntoisanEditoredited. @paramanEditorcellEditor the newdata cell editorcellEditor @see #getCellEditor @beaninfo bound: true description: The editor to use for cell values.
Sets theClass TableColumn, void setHeaderRenderer(TableCellRenderer)TableCellRendererused byJTableto draw individual values for this columnto aRenderer.Posts a@parambound property change notificationcellRenderer the new cellRendererwith@seethe#getCellRenderername@beaninfoCELL_RENDERER_PROPERTY.bound:@paramtrueaRendererdescription:the new data cell rendererThe renderer to use for@seecell#getCellRenderervalues.
Sets theClass TableColumn, void setHeaderValue(Object)TableCellRendererused to draw theTableColumn's header toaRendererheaderRenderer.Posts a bound property change notification@paramwithheaderRenderer thenamenewHEADER_RENDERER_PROPERTY.headerRenderer @exception IllegalArgumentException if aRenderer isseenull.#getHeaderRenderer @parambeaninfoaRendererbound:thetruenewdescription: The header renderer@see #getHeaderRenderer.
Sets theClass TableColumn, void setIdentifier(Object)Objectwhose string representation will be used as the value for theheaderRenderer.Posts aWhen theboundTableColumnproperty change notification withis created the defaulttheheaderValuenameisHEADER_VALUE_PROPERTYnull. @paramaValueheaderValue the newheader valueheaderValue @see #getHeaderValue @beaninfo bound: true description: The text to be used by the header renderer.
Sets theClass TableColumn, void setMaxWidth(int)TableColumn's identifier toanIdentifier.Note: identifiers are not used by the
JTablethey are purely a convenience for the external tagging and location of columns. @paramanIdentifieridentifier an identifier for this column @see #getIdentifier @beaninfo bound: true description: A unique identifier for this column.
Sets theClass TableColumn, void setMinWidth(int)TableColumn's maximum width tonewMaxWidthmaxWidth; alsoadjustingadjusts thecurrentwidth and preferred width ifit'sthey are greater than this value. @paramnewMaxWidthmaxWidth the new maximum widthvalue@see #getMaxWidth @see #setPreferredWidth @see #setMinWidth @beaninfo bound: true description: The maximum width of the column.
Sets theClass TableColumn, void setModelIndex(int)TableColumn's minimum width tonewMinWidthminWidth; alsoadjustingadjusts the current width and preferred width ifit'sthey are less than this value. @paramnewMinWidthminWidth the new minimum widthvalue@see #getMinWidth @see #setPreferredWidth @see #setMaxWidth @beaninfo bound: true description: The minimum width of the column.
Sets the model index for this column. The model index is the index of the column in the model that will be displayed by thisClass TableColumn, void setPreferredWidth(int)TableColumn. As theTableColumnis moved around in the view the model index remains constant. @param modelIndex the new modelIndex @beaninfo bound: true description: The model index.
Sets this column's preferred width toClass TableColumn, void setResizable(boolean)preferredWidth. IfpreferredWidthexceeds the minimum or maximum width it'sis adjusted to the appropriate limiting value.For details on how the widths of columns in the
JTable(andJTableHeader) are calculated from thepreferredWidthsee thesizeColumnsToFitmethod in(int)theJTable. @param preferredWidthThethe new preferred width.@see #getPreferredWidth @see JTable#sizeColumnsToFit(int) @beaninfo bound: true description: The preferred width of the column.
Sets whetherClass TableColumn, void setWidth(int)the userthis column canresize the receiver inbeits JTableViewresized. @paramflagisResizable if trueif theresizing iscolumnallowed;isResizableotherwise false @see #getResizable @beaninfo bound: true description: Whether or not this column can be resized.
This method should not be used to set the widths of columns in theClass TableColumn, void sizeWidthToFit()JTable-usesetPreferredWidthinstead. Like a layout manager in the AWT the()JTableadjusts a column's width automatically whenever the table itself changes size or a column's preferred width is changed. Setting widths programmatically therefore has no long term effect.This
methodsmethod sets this column's width tonewWidthwidth. IfnewWidthwidthexceeds the minimum or maximum width it'sis adjusted to the appropriate limiting value.Posts a bound property change notification with the name COLUMN_WIDTH_PROPERTY.@param
newWidth Thewidth the new widthvalue@see #getWidth @see #setMinWidth @see #setMaxWidth @see #setPreferredWidth @see JTable#sizeColumnsToFit(int) @beaninfo bound: true description: The width of the column.
Resizes theClass TableColumn, String CELL_RENDERER_PROPERTYTableColumnto fit the width of its header cell.IfThisthe maximum width is less than the width of the header the maximum is increased to the header'smethodwidth.doesSimilarlynothing if theminimum width is greater than the width of theheaderthe minimumrenderer isreduced tonull(theheader'sdefaultwidthcase). @see #setPreferredWidth
Class TableColumn, String COLUMN_WIDTH_PROPERTYBound propertyObsolete asnameof Java 2 platform v1.3. Please use string literals to identify properties.
Class TableColumn, String HEADER_RENDERER_PROPERTYBound propertyObsolete asnameof Java 2 platform v1.3. Please use string literals to identify properties.
Class TableColumn, String HEADER_VALUE_PROPERTYBound propertyObsolete asnameof Java 2 platform v1.3. Please use string literals to identify properties.
Class TableColumn, TableCellEditor cellEditorBound propertyObsolete asnameof Java 2 platform v1.3. Please use string literals to identify properties.
The editor used to edit the data cells of the column.Class TableColumn, TableCellRenderer cellRenderer
The renderer used to draw the data cells of the column.Class TableColumn, TableCellRenderer headerRenderer
The renderer used to draw the header of the column.Class TableColumn, Object headerValue
The header value of the column.Class TableColumn, Object identifier
This object is not used internally by the drawing machinery of theClass TableColumn, boolean isResizableJTable;.Identifiersidentifiers may be set in theTableColumnas as an optional way to tag and locateTableColumnstable columns. The table package does not modify or invoke any methods in these identifer objects other than theequalsmethod which is used in thegetColumnIndex()method in theDefaultTableColumnModel.
Class TableColumn, int maxWidthResizableIfflagtrue the user is allowed to resize the column; the default is true.
The maximum width of the column.Class TableColumn, int minWidth
The minimum width of the column.Class TableColumn, int modelIndex
The index of the column in the model which is to be displayed by thisClass TableColumn, int resizedPostingDisableCountTableColumn. As columns are moved around in the viewthe model indexmodelIndexremains constant.
Class TableColumn, int widthCounterThis field was not usedto disable postingin previous releasesofand there are currently noresizingplansnotificationsto supportuntilit in theendfuture. @deprecated as oftheJava 2 platformresizev1.3
The width of the column.
Defines the requirements for a table column model object suitable for use withClass TableColumnModel, void addColumn(TableColumn)JTable. @version 1.16 0820 02/2602/9800 @author Alan Chung @author Philip Milne @see DefaultTableColumnModel
AppendsClass TableColumnModel, void addColumnModelListener(TableColumnModelListener)aColumnto the end of thereceiver'stableColumnsarray. This methodalsopoststheacolumnAddedevent to its listeners. @param aColumn()ThetheTableColumn to be added @see #removeColumn
Class TableColumnModel, TableColumn getColumn(int)AddAdds a listener for table column model events. @param x aTableColumnModelListenerobject
Returns theClass TableColumnModel, int getColumnCount()TableColumnobject for the column atcolumnIndex. @return the TableColumn object forparam columnIndex the index of thecolumn atdesiredcolumnIndexcolumn @param columnIndexreturn theindexTableColumnofobject for the columndesiredatcolumnIndex
Returns the number of columns in the model. @return the number of columns in the modelClass TableColumnModel, int getColumnIndex(Object)
Returns the index of the first column in theClass TableColumnModel, int getColumnIndexAtX(int)receiver's columns arraytable whose identifier is equal toidentifierwhen compared usingequals. @param columnIdentifier the identifier object @return the index of the first table column()in the receiver's tableColumns arraywhose identifier is equal toidentifier@exception IllegalArgumentException ifwhen compared using equals(). @param identifier the identifier objectidentifierisnullor noTableColumnhas thisidentifier@see #getColumn
Returns the index of the column that lies on the horizontal point xPosition; or -1 if it lies outside the any of the column's bounds. @return the index of the column; or -1 if no column is found
Class TableColumnModel, int getColumnMargin()Returns the widthClass TableColumnModel, boolean getColumnSelectionAllowed()marginbetween the cells in each column. @return the margin in pixels between the cells
Returns true if columnsClass TableColumnModel, Enumeration getColumns()canmay be selected. @return true if columnscanmay be selected @see #setColumnSelectionAllowed
Returns anClass TableColumnModel, int getSelectedColumnCount()Enumerationof all the columns in the model. @return anEnumerationof all the columns in the model
Returns the number of selected columns. @return the number of selected columns; or 0 if no columns are selectedClass TableColumnModel, int[] getSelectedColumns()
Returns an array ofClass TableColumnModel, ListSelectionModel getSelectionModel()indexesindiciesforof all selected columns. @return an array ofints givingintegers containing theindexesindicies of all selected columns; or an emptyintarray ifno columnnothing is selected.
Returns the current selection model. @return aClass TableColumnModel, int getTotalColumnWidth()ListSelectionModelobjectrepresenting the selection model val@see #setSelectionModel
Returns the total width of all the columns. @return the total computed width of all columnsClass TableColumnModel, void moveColumn(int, int)
Moves the column andClass TableColumnModel, void removeColumn(TableColumn)headingits header atcolumnIndextonewIndex. The old column atcolumnIndexwill now be found atnewIndex. The column that used to be atnewIndexis shifted left or right to make room. This will not move any columns ifcolumnIndexequalsnewIndex. This methodalsopoststheacolumnMovedevent to its listeners. @param columnIndex the index of column to be moved @param newIndex()Newindexto moveof the column's new location @exception IllegalArgumentException ifcolumncolumnIndexornewIndexare not in the valid range
Deletes theClass TableColumnModel, void removeColumnModelListener(TableColumnModelListener)TableColumncolumnfrom thereceiver's table columnstableColumnsarray. This method will do nothing ifcolumnis not in the table'scolumnscolumn list. This methodalsopoststheacolumnRemovedevent to its listeners. @param column()ThetheTableColumn to be removed @see #addColumn
Class TableColumnModel, void setColumnMargin(int)RemoveRemoves a listener for table column model events. @param x aTableColumnModelListenerobject
Sets theClass TableColumnModel, void setColumnSelectionAllowed(boolean)TableColumn's column margin tonewMargin. This methodalsopoststheacolumnMarginChangedevent to its listeners. @param newMargin the width()marginin pixels of the new column margins @see #getColumnMargin
Sets whether the columns in this modelClass TableColumnModel, void setSelectionModel(ListSelectionModel)canmay be selected. @param flag true if columns may be selected; otherwise false @see #getColumnSelectionAllowed
Sets the selection modelwhich handles selections. @param newModel aListSelectionModelobject @see #getSelectionModel
TheClass TableModel, void addTableModelListener(TableModelListener)TableModelinterfaceispecifiesspecifies the methods theJTablewill use to interrogate a tabular data model.The
JTablecan be set up to display any data model which implements theTableModelinterface with a couple of lines of code:
TableModel myData = new MyTableModel(); JTable table = new JTable(myData);For further documentation see Creating a Table Model in The Java Tutorial.
@version 1.
15 0822 02/2602/9800 @author Philip Milne @author Alan Chung @see JTable@see AbstractTableModel
Class TableModel, Class getColumnClass(int)AddAdds a listener to the list that'sis notified each time a change to the data model occurs. @param l the TableModelListener
Returns theClass TableModel, int getColumnCount()lowestmostcommonspecific superclass for alldenominatorthe cellClassvalues in the column. This is used by thetableJTableto set up a default renderer and editor for the column. @param columnIndex the index of the column @return the common ancestor class of the object values in the model.
Returns the number of columnsClass TableModel, String getColumnName(int)managed byin thedata source objectmodel. AJTableuses this method to determine how many columns it should create and displayon initializationby default. @return the numberorof columns in the model @see #getRowCount
Returns the name of the column atClass TableModel, int getRowCount()columnIndex. This is used to initialize the table's column header name. Note: this name does not need to be unique. Two; two columnsonin a table can have the same name. @param columnIndex the index of the column @return the name of the column
Returns the number ofClass TableModel, Object getValueAt(int, int)records managedrowsbyin thedata source objectmodel. AJTableuses this method to determine how many rows it shouldcreate anddisplay. This method should be quick as it iscall bycalledJTablefrequentlyquite frequentlyduring rendering. @return the numberorof rows in the model @see #getColumnCount
ReturnsClass TableModel, boolean isCellEditable(int, int)an attributethe value for the cell atcolumnIndexandrowIndex. @param rowIndex the row whose value is to belookedqueriedup@param columnIndex the column whose value is to belooked upqueried @return the value Object at the specified cell
Returns true if the cell atClass TableModel, void removeTableModelListener(TableModelListener)rowIndexandcolumnIndexis editable. OtherwisesetValueAton the cell will not change the value of that cell. @param rowIndex the row whose value()isto belookedqueriedup@param columnIndex the column whose valueisto belooked upqueried @return true if the cell is editable.@see #setValueAt
Class TableModel, void setValueAt(Object, int, int)RemoveRemoves a listener from the list that'sis notified each time a change to the data model occurs. @param l the TableModelListener
Setsan attribute value fortherecordvalue in the cell atcolumnIndexandrowIndex. aValueis the newtovalueaValue. @param aValue the new value @param rowIndex the row whose value is to be changed @param columnIndex the column whose value is to be changed @see #getValueAt @see #isCellEditable