javax.swing
Class JTable

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Component sample code for java.awt.Component definition code for java.awt.Component 
      extended by java.awt.Container sample code for java.awt.Container definition code for java.awt.Container 
          extended by javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent 
              extended by javax.swing.JTable
All Implemented Interfaces:
ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver , MenuContainer sample code for java.awt.MenuContainer definition code for java.awt.MenuContainer , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , EventListener sample code for java.util.EventListener definition code for java.util.EventListener , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible , CellEditorListener sample code for javax.swing.event.CellEditorListener definition code for javax.swing.event.CellEditorListener , ListSelectionListener sample code for javax.swing.event.ListSelectionListener definition code for javax.swing.event.ListSelectionListener , TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener , TableModelListener sample code for javax.swing.event.TableModelListener definition code for javax.swing.event.TableModelListener , Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable

public class JTable
extends JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
implements TableModelListener sample code for javax.swing.event.TableModelListener definition code for javax.swing.event.TableModelListener , Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable , TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener , ListSelectionListener sample code for javax.swing.event.ListSelectionListener definition code for javax.swing.event.ListSelectionListener , CellEditorListener sample code for javax.swing.event.CellEditorListener definition code for javax.swing.event.CellEditorListener , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

The JTable is used to display and edit regular two-dimensional tables of cells. See How to Use Tables in The Java Tutorial for task-oriented documentation and examples of using JTable.

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:

      TableModel dataModel = new AbstractTableModel() {
          public int getColumnCount() { return 10; }
          public int getRowCount() { return 10;}
          public Object getValueAt(int row, int col) { return new Integer(row*col); }
      };
      JTable table = new JTable(dataModel);
      JScrollPane scrollpane = 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 getTableHeader() sample code for javax.swing.JTable.getTableHeader() definition code for javax.swing.JTable.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 "TableExample" directory in the demo area of the source distribution gives a number of complete examples of JTable usage, covering how the JTable can be used to provide an editable view of data taken from a database and how to modify the columns in the display to use specialized renderers and editors.

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.

So, when writing a TableModel, it is not necessary to listen for column reordering events as the model will be queried in its own coordinate system regardless of what is happening in the view. In the examples area there is a demonstration of a sorting algorithm making use of exactly this technique to interpose yet another coordinate system where the order of the rows is changed, rather than the order of the columns.

J2SE 5 adds methods to JTable to provide convenient access to some common printing needs. Simple new print() sample code for javax.swing.JTable.print() definition code for javax.swing.JTable.print() methods allow for quick and easy addition of printing support to your application. In addition, a new getPrintable(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat) sample code for javax.swing.JTable.getPrintable(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat) definition code for javax.swing.JTable.getPrintable(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat) method is available for more advanced printing needs.

As for all JComponent classes, you can use InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap and ActionMap sample code for javax.swing.ActionMap definition code for javax.swing.ActionMap to associate an Action sample code for javax.swing.Action definition code for javax.swing.Action object with a KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke and execute the action under specified conditions.

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. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
Serialized Form

Nested Class Summary
protected  class JTable.AccessibleJTable sample code for javax.swing.JTable.AccessibleJTable definition code for javax.swing.JTable.AccessibleJTable
          This class implements accessibility support for the JTable class.
static class JTable.PrintMode sample code for javax.swing.JTable.PrintMode definition code for javax.swing.JTable.PrintMode
          Printing modes, used in printing JTables.
 
Nested classes/interfaces inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
JComponent.AccessibleJComponent sample code for javax.swing.JComponent.AccessibleJComponent definition code for javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
Container.AccessibleAWTContainer sample code for java.awt.Container.AccessibleAWTContainer definition code for java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
Component.AccessibleAWTComponent sample code for java.awt.Component.AccessibleAWTComponent definition code for java.awt.Component.AccessibleAWTComponent , Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy definition code for java.awt.Component.BltBufferStrategy , Component.FlipBufferStrategy sample code for java.awt.Component.FlipBufferStrategy definition code for java.awt.Component.FlipBufferStrategy
 
Field Summary
static int AUTO_RESIZE_ALL_COLUMNS sample code for javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS definition code for javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS
          During all resize operations, proportionately resize all columns.
static int AUTO_RESIZE_LAST_COLUMN sample code for javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN definition code for javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN
          During all resize operations, apply adjustments to the last column only.
static int AUTO_RESIZE_NEXT_COLUMN sample code for javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN definition code for javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN
          When a column is adjusted in the UI, adjust the next column the opposite way.
static int AUTO_RESIZE_OFF sample code for javax.swing.JTable.AUTO_RESIZE_OFF definition code for javax.swing.JTable.AUTO_RESIZE_OFF
          Do not adjust column widths automatically; use a scrollbar.
static int AUTO_RESIZE_SUBSEQUENT_COLUMNS sample code for javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS definition code for javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS
          During UI adjustment, change subsequent columns to preserve the total width; this is the default behavior.
protected  boolean autoCreateColumnsFromModel sample code for javax.swing.JTable.autoCreateColumnsFromModel definition code for javax.swing.JTable.autoCreateColumnsFromModel
          The table will query the TableModel to build the default set of columns if this is true.
protected  int autoResizeMode sample code for javax.swing.JTable.autoResizeMode definition code for javax.swing.JTable.autoResizeMode
          Determines if the table automatically resizes the width of the table's columns to take up the entire width of the table, and how it does the resizing.
protected  TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor cellEditor sample code for javax.swing.JTable.cellEditor definition code for javax.swing.JTable.cellEditor
          The object that overwrites the screen real estate occupied by the current cell and allows the user to change its contents.
protected  boolean cellSelectionEnabled sample code for javax.swing.JTable.cellSelectionEnabled definition code for javax.swing.JTable.cellSelectionEnabled
          Obsolete as of Java 2 platform v1.3.
protected  TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel columnModel sample code for javax.swing.JTable.columnModel definition code for javax.swing.JTable.columnModel
          The TableColumnModel of the table.
protected  TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel dataModel sample code for javax.swing.JTable.dataModel definition code for javax.swing.JTable.dataModel
          The TableModel of the table.
protected  Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable defaultEditorsByColumnClass sample code for javax.swing.JTable.defaultEditorsByColumnClass definition code for javax.swing.JTable.defaultEditorsByColumnClass
          A table of objects that display and edit the contents of a cell, indexed by class as declared in getColumnClass in the TableModel interface.
protected  Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable defaultRenderersByColumnClass sample code for javax.swing.JTable.defaultRenderersByColumnClass definition code for javax.swing.JTable.defaultRenderersByColumnClass
          A table of objects that display the contents of a cell, indexed by class as declared in getColumnClass in the TableModel interface.
protected  int editingColumn sample code for javax.swing.JTable.editingColumn definition code for javax.swing.JTable.editingColumn
          Identifies the column of the cell being edited.
protected  int editingRow sample code for javax.swing.JTable.editingRow definition code for javax.swing.JTable.editingRow
          Identifies the row of the cell being edited.
protected  Component sample code for java.awt.Component definition code for java.awt.Component editorComp sample code for javax.swing.JTable.editorComp definition code for javax.swing.JTable.editorComp
          If editing, the Component that is handling the editing.
protected  Color sample code for java.awt.Color definition code for java.awt.Color gridColor sample code for javax.swing.JTable.gridColor definition code for javax.swing.JTable.gridColor
          The color of the grid.
protected  Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension preferredViewportSize sample code for javax.swing.JTable.preferredViewportSize definition code for javax.swing.JTable.preferredViewportSize
          Used by the Scrollable interface to determine the initial visible area.
protected  int rowHeight sample code for javax.swing.JTable.rowHeight definition code for javax.swing.JTable.rowHeight
          The height in pixels of each row in the table.
protected  int rowMargin sample code for javax.swing.JTable.rowMargin definition code for javax.swing.JTable.rowMargin
          The height in pixels of the margin between the cells in each row.
protected  boolean rowSelectionAllowed sample code for javax.swing.JTable.rowSelectionAllowed definition code for javax.swing.JTable.rowSelectionAllowed
          True if row selection is allowed in this table.
protected  Color sample code for java.awt.Color definition code for java.awt.Color selectionBackground sample code for javax.swing.JTable.selectionBackground definition code for javax.swing.JTable.selectionBackground
          The background color of selected cells.
protected  Color sample code for java.awt.Color definition code for java.awt.Color selectionForeground sample code for javax.swing.JTable.selectionForeground definition code for javax.swing.JTable.selectionForeground
          The foreground color of selected cells.
protected  ListSelectionModel sample code for javax.swing.ListSelectionModel definition code for javax.swing.ListSelectionModel selectionModel sample code for javax.swing.JTable.selectionModel definition code for javax.swing.JTable.selectionModel
          The ListSelectionModel of the table, used to keep track of row selections.
protected  boolean showHorizontalLines sample code for javax.swing.JTable.showHorizontalLines definition code for javax.swing.JTable.showHorizontalLines
          The table draws horizontal lines between cells if showHorizontalLines is true.
protected  boolean showVerticalLines sample code for javax.swing.JTable.showVerticalLines definition code for javax.swing.JTable.showVerticalLines
          The table draws vertical lines between cells if showVerticalLines is true.
protected  JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader tableHeader sample code for javax.swing.JTable.tableHeader definition code for javax.swing.JTable.tableHeader
          The TableHeader working with the table.
 
Fields inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
accessibleContext sample code for javax.swing.JComponent.accessibleContext definition code for javax.swing.JComponent.accessibleContext , listenerList sample code for javax.swing.JComponent.listenerList definition code for javax.swing.JComponent.listenerList , TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY definition code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY , ui sample code for javax.swing.JComponent.ui definition code for javax.swing.JComponent.ui , UNDEFINED_CONDITION sample code for javax.swing.JComponent.UNDEFINED_CONDITION definition code for javax.swing.JComponent.UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT sample code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT definition code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED sample code for javax.swing.JComponent.WHEN_FOCUSED definition code for javax.swing.JComponent.WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW sample code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW definition code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
BOTTOM_ALIGNMENT sample code for java.awt.Component.BOTTOM_ALIGNMENT definition code for java.awt.Component.BOTTOM_ALIGNMENT , CENTER_ALIGNMENT sample code for java.awt.Component.CENTER_ALIGNMENT definition code for java.awt.Component.CENTER_ALIGNMENT , LEFT_ALIGNMENT sample code for java.awt.Component.LEFT_ALIGNMENT definition code for java.awt.Component.LEFT_ALIGNMENT , RIGHT_ALIGNMENT sample code for java.awt.Component.RIGHT_ALIGNMENT definition code for java.awt.Component.RIGHT_ALIGNMENT , TOP_ALIGNMENT sample code for java.awt.Component.TOP_ALIGNMENT definition code for java.awt.Component.TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver
ABORT sample code for java.awt.image.ImageObserver.ABORT definition code for java.awt.image.ImageObserver.ABORT , ALLBITS sample code for java.awt.image.ImageObserver.ALLBITS definition code for java.awt.image.ImageObserver.ALLBITS , ERROR sample code for java.awt.image.ImageObserver.ERROR definition code for java.awt.image.ImageObserver.ERROR , FRAMEBITS sample code for java.awt.image.ImageObserver.FRAMEBITS definition code for java.awt.image.ImageObserver.FRAMEBITS , HEIGHT sample code for java.awt.image.ImageObserver.HEIGHT definition code for java.awt.image.ImageObserver.HEIGHT , PROPERTIES sample code for java.awt.image.ImageObserver.PROPERTIES definition code for java.awt.image.ImageObserver.PROPERTIES , SOMEBITS sample code for java.awt.image.ImageObserver.SOMEBITS definition code for java.awt.image.ImageObserver.SOMEBITS , WIDTH sample code for java.awt.image.ImageObserver.WIDTH definition code for java.awt.image.ImageObserver.WIDTH
 
Constructor Summary
JTable sample code for javax.swing.JTable.JTable() definition code for javax.swing.JTable.JTable() ()
          Constructs a default JTable that is initialized with a default data model, a default column model, and a default selection model.
JTable sample code for javax.swing.JTable.JTable(int, int) definition code for javax.swing.JTable.JTable(int, int) (int numRows, int numColumns)
          Constructs a JTable with numRows and numColumns of empty cells using DefaultTableModel.
JTable sample code for javax.swing.JTable.JTable(java.lang.Object[][], java.lang.Object[]) definition code for javax.swing.JTable.JTable(java.lang.Object[][], java.lang.Object[]) (Object sample code for java.lang.Object definition code for java.lang.Object [][] rowData, Object sample code for java.lang.Object definition code for java.lang.Object [] columnNames)
          Constructs a JTable to display the values in the two dimensional array, rowData, with column names, columnNames.
JTable sample code for javax.swing.JTable.JTable(javax.swing.table.TableModel) definition code for javax.swing.JTable.JTable(javax.swing.table.TableModel) (TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel  dm)
          Constructs a JTable that is initialized with dm as the data model, a default column model, and a default selection model.
JTable sample code for javax.swing.JTable.JTable(javax.swing.table.TableModel, javax.swing.table.TableColumnModel) definition code for javax.swing.JTable.JTable(javax.swing.table.TableModel, javax.swing.table.TableColumnModel) (TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel  dm, TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel  cm)
          Constructs a JTable that is initialized with dm as the data model, cm as the column model, and a default selection model.
JTable sample code for javax.swing.JTable.JTable(javax.swing.table.TableModel, javax.swing.table.TableColumnModel, javax.swing.ListSelectionModel) definition code for javax.swing.JTable.JTable(javax.swing.table.TableModel, javax.swing.table.TableColumnModel, javax.swing.ListSelectionModel) (TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel  dm, TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel  cm, ListSelectionModel sample code for javax.swing.ListSelectionModel definition code for javax.swing.ListSelectionModel  sm)
          Constructs a JTable that is initialized with dm as the data model, cm as the column model, and sm as the selection model.
JTable sample code for javax.swing.JTable.JTable(java.util.Vector, java.util.Vector) definition code for javax.swing.JTable.JTable(java.util.Vector, java.util.Vector) (Vector sample code for java.util.Vector definition code for java.util.Vector  rowData, Vector sample code for java.util.Vector definition code for java.util.Vector  columnNames)
          Constructs a JTable to display the values in the Vector of Vectors, rowData, with column names, columnNames.
 
Method Summary
 void addColumn sample code for javax.swing.JTable.addColumn(javax.swing.table.TableColumn) definition code for javax.swing.JTable.addColumn(javax.swing.table.TableColumn) (TableColumn sample code for javax.swing.table.TableColumn definition code for javax.swing.table.TableColumn  aColumn)
          Appends aColumn to the end of the array of columns held by this JTable's column model.
 void addColumnSelectionInterval sample code for javax.swing.JTable.addColumnSelectionInterval(int, int) definition code for javax.swing.JTable.addColumnSelectionInterval(int, int) (int index0, int index1)
          Adds the columns from index0 to index1, inclusive, to the current selection.
 void addNotify sample code for javax.swing.JTable.addNotify() definition code for javax.swing.JTable.addNotify() ()
          Calls the configureEnclosingScrollPane method.
 void addRowSelectionInterval sample code for javax.swing.JTable.addRowSelectionInterval(int, int) definition code for javax.swing.JTable.addRowSelectionInterval(int, int) (int index0, int index1)
          Adds the rows from index0 to index1, inclusive, to the current selection.
 void changeSelection sample code for javax.swing.JTable.changeSelection(int, int, boolean, boolean) definition code for javax.swing.JTable.changeSelection(int, int, boolean, boolean) (int rowIndex, int columnIndex, boolean toggle, boolean extend)
          Updates the selection models of the table, depending on the state of the two flags: toggle and extend.
 void clearSelection sample code for javax.swing.JTable.clearSelection() definition code for javax.swing.JTable.clearSelection() ()
          Deselects all selected columns and rows.
 void columnAdded sample code for javax.swing.JTable.columnAdded(javax.swing.event.TableColumnModelEvent) definition code for javax.swing.JTable.columnAdded(javax.swing.event.TableColumnModelEvent) (TableColumnModelEvent sample code for javax.swing.event.TableColumnModelEvent definition code for javax.swing.event.TableColumnModelEvent  e)
          Invoked when a column is added to the table column model.
 int columnAtPoint sample code for javax.swing.JTable.columnAtPoint(java.awt.Point) definition code for javax.swing.JTable.columnAtPoint(java.awt.Point) (Point sample code for java.awt.Point definition code for java.awt.Point  point)
          Returns the index of the column that point lies in, or -1 if the result is not in the range [0, getColumnCount()-1].
 void columnMarginChanged sample code for javax.swing.JTable.columnMarginChanged(javax.swing.event.ChangeEvent) definition code for javax.swing.JTable.columnMarginChanged(javax.swing.event.ChangeEvent) (ChangeEvent sample code for javax.swing.event.ChangeEvent definition code for javax.swing.event.ChangeEvent  e)
          Invoked when a column is moved due to a margin change.
 void columnMoved sample code for javax.swing.JTable.columnMoved(javax.swing.event.TableColumnModelEvent) definition code for javax.swing.JTable.columnMoved(javax.swing.event.TableColumnModelEvent) (TableColumnModelEvent sample code for javax.swing.event.TableColumnModelEvent definition code for javax.swing.event.TableColumnModelEvent  e)
          Invoked when a column is repositioned.
 void columnRemoved sample code for javax.swing.JTable.columnRemoved(javax.swing.event.TableColumnModelEvent) definition code for javax.swing.JTable.columnRemoved(javax.swing.event.TableColumnModelEvent) (TableColumnModelEvent sample code for javax.swing.event.TableColumnModelEvent definition code for javax.swing.event.TableColumnModelEvent  e)
          Invoked when a column is removed from the table column model.
 void columnSelectionChanged sample code for javax.swing.JTable.columnSelectionChanged(javax.swing.event.ListSelectionEvent) definition code for javax.swing.JTable.columnSelectionChanged(javax.swing.event.ListSelectionEvent) (ListSelectionEvent sample code for javax.swing.event.ListSelectionEvent definition code for javax.swing.event.ListSelectionEvent  e)
          Invoked when the selection model of the TableColumnModel is changed.
protected  void configureEnclosingScrollPane sample code for javax.swing.JTable.configureEnclosingScrollPane() definition code for javax.swing.JTable.configureEnclosingScrollPane() ()
          If this JTable is the viewportView of an enclosing JScrollPane (the usual situation), configure this ScrollPane by, amongst other things, installing the table's tableHeader as the columnHeaderView of the scroll pane.
 int convertColumnIndexToModel sample code for javax.swing.JTable.convertColumnIndexToModel(int) definition code for javax.swing.JTable.convertColumnIndexToModel(int) (int viewColumnIndex)
          Maps the index of the column in the view at viewColumnIndex to the index of the column in the table model.
 int convertColumnIndexToView sample code for javax.swing.JTable.convertColumnIndexToView(int) definition code for javax.swing.JTable.convertColumnIndexToView(int) (int modelColumnIndex)
          Maps the index of the column in the table model at modelColumnIndex to the index of the column in the view.
protected  TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel createDefaultColumnModel sample code for javax.swing.JTable.createDefaultColumnModel() definition code for javax.swing.JTable.createDefaultColumnModel() ()
          Returns the default column model object, which is a DefaultTableColumnModel.
 void createDefaultColumnsFromModel sample code for javax.swing.JTable.createDefaultColumnsFromModel() definition code for javax.swing.JTable.createDefaultColumnsFromModel() ()
          Creates default columns for the table from the data model using the getColumnCount method defined in the TableModel interface.
protected  TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel createDefaultDataModel sample code for javax.swing.JTable.createDefaultDataModel() definition code for javax.swing.JTable.createDefaultDataModel() ()
          Returns the default table model object, which is a DefaultTableModel.
protected  void createDefaultEditors sample code for javax.swing.JTable.createDefaultEditors() definition code for javax.swing.JTable.createDefaultEditors() ()
          Creates default cell editors for objects, numbers, and boolean values.
protected  void createDefaultRenderers sample code for javax.swing.JTable.createDefaultRenderers() definition code for javax.swing.JTable.createDefaultRenderers() ()
          Creates default cell renderers for objects, numbers, doubles, dates, booleans, and icons.
protected  ListSelectionModel sample code for javax.swing.ListSelectionModel definition code for javax.swing.ListSelectionModel createDefaultSelectionModel