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 sample code for javax.swing.JTable.createDefaultSelectionModel() definition code for javax.swing.JTable.createDefaultSelectionModel() ()
          Returns the default selection model object, which is a DefaultListSelectionModel.
protected  JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader createDefaultTableHeader sample code for javax.swing.JTable.createDefaultTableHeader() definition code for javax.swing.JTable.createDefaultTableHeader() ()
          Returns the default table header object, which is a JTableHeader.
static JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane createScrollPaneForTable sample code for javax.swing.JTable.createScrollPaneForTable(javax.swing.JTable) definition code for javax.swing.JTable.createScrollPaneForTable(javax.swing.JTable) (JTable sample code for javax.swing.JTable definition code for javax.swing.JTable  aTable)
          Deprecated. As of Swing version 1.0.2, replaced by new JScrollPane(aTable).
 void doLayout sample code for javax.swing.JTable.doLayout() definition code for javax.swing.JTable.doLayout() ()
          Causes this table to lay out its rows and columns.
 boolean editCellAt sample code for javax.swing.JTable.editCellAt(int, int) definition code for javax.swing.JTable.editCellAt(int, int) (int row, int column)
          Programmatically starts editing the cell at row and column, if those indices are in the valid range, and the cell at those indices is editable.
 boolean editCellAt sample code for javax.swing.JTable.editCellAt(int, int, java.util.EventObject) definition code for javax.swing.JTable.editCellAt(int, int, java.util.EventObject) (int row, int column, EventObject sample code for java.util.EventObject definition code for java.util.EventObject  e)
          Programmatically starts editing the cell at row and column, if those indices are in the valid range, and the cell at those indices is editable.
 void editingCanceled sample code for javax.swing.JTable.editingCanceled(javax.swing.event.ChangeEvent) definition code for javax.swing.JTable.editingCanceled(javax.swing.event.ChangeEvent) (ChangeEvent sample code for javax.swing.event.ChangeEvent definition code for javax.swing.event.ChangeEvent  e)
          Invoked when editing is canceled.
 void editingStopped sample code for javax.swing.JTable.editingStopped(javax.swing.event.ChangeEvent) definition code for javax.swing.JTable.editingStopped(javax.swing.event.ChangeEvent) (ChangeEvent sample code for javax.swing.event.ChangeEvent definition code for javax.swing.event.ChangeEvent  e)
          Invoked when editing is finished.
 AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext getAccessibleContext sample code for javax.swing.JTable.getAccessibleContext() definition code for javax.swing.JTable.getAccessibleContext() ()
          Gets the AccessibleContext associated with this JTable.
 boolean getAutoCreateColumnsFromModel sample code for javax.swing.JTable.getAutoCreateColumnsFromModel() definition code for javax.swing.JTable.getAutoCreateColumnsFromModel() ()
          Determines whether the table will create default columns from the model.
 int getAutoResizeMode sample code for javax.swing.JTable.getAutoResizeMode() definition code for javax.swing.JTable.getAutoResizeMode() ()
          Returns the auto resize mode of the table.
 TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor getCellEditor sample code for javax.swing.JTable.getCellEditor() definition code for javax.swing.JTable.getCellEditor() ()
          Returns the cell editor.
 TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor getCellEditor sample code for javax.swing.JTable.getCellEditor(int, int) definition code for javax.swing.JTable.getCellEditor(int, int) (int row, int column)
          Returns an appropriate editor for the cell specified by row and column.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getCellRect sample code for javax.swing.JTable.getCellRect(int, int, boolean) definition code for javax.swing.JTable.getCellRect(int, int, boolean) (int row, int column, boolean includeSpacing)
          Returns a rectangle for the cell that lies at the intersection of row and column.
 TableCellRenderer sample code for javax.swing.table.TableCellRenderer definition code for javax.swing.table.TableCellRenderer getCellRenderer sample code for javax.swing.JTable.getCellRenderer(int, int) definition code for javax.swing.JTable.getCellRenderer(int, int) (int row, int column)
          Returns an appropriate renderer for the cell specified by this row and column.
 boolean getCellSelectionEnabled sample code for javax.swing.JTable.getCellSelectionEnabled() definition code for javax.swing.JTable.getCellSelectionEnabled() ()
          Returns true if both row and column selection models are enabled.
 TableColumn sample code for javax.swing.table.TableColumn definition code for javax.swing.table.TableColumn getColumn sample code for javax.swing.JTable.getColumn(java.lang.Object) definition code for javax.swing.JTable.getColumn(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  identifier)
          Returns the TableColumn object for the column in the table whose identifier is equal to identifier, when compared using equals.
 Class sample code for java.lang.Class definition code for java.lang.Class <?> getColumnClass sample code for javax.swing.JTable.getColumnClass(int) definition code for javax.swing.JTable.getColumnClass(int) (int column)
          Returns the type of the column appearing in the view at column position column.
 int getColumnCount sample code for javax.swing.JTable.getColumnCount() definition code for javax.swing.JTable.getColumnCount() ()
          Returns the number of columns in the column model.
 TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel getColumnModel sample code for javax.swing.JTable.getColumnModel() definition code for javax.swing.JTable.getColumnModel() ()
          Returns the TableColumnModel that contains all column information of this table.
 String sample code for java.lang.String definition code for java.lang.String getColumnName sample code for javax.swing.JTable.getColumnName(int) definition code for javax.swing.JTable.getColumnName(int) (int column)
          Returns the name of the column appearing in the view at column position column.
 boolean getColumnSelectionAllowed sample code for javax.swing.JTable.getColumnSelectionAllowed() definition code for javax.swing.JTable.getColumnSelectionAllowed() ()
          Returns true if columns can be selected.
 TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor getDefaultEditor sample code for javax.swing.JTable.getDefaultEditor(java.lang.Class) definition code for javax.swing.JTable.getDefaultEditor(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class <?> columnClass)
          Returns the editor to be used when no editor has been set in a TableColumn.
 TableCellRenderer sample code for javax.swing.table.TableCellRenderer definition code for javax.swing.table.TableCellRenderer getDefaultRenderer sample code for javax.swing.JTable.getDefaultRenderer(java.lang.Class) definition code for javax.swing.JTable.getDefaultRenderer(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class <?> columnClass)
          Returns the cell renderer to be used when no renderer has been set in a TableColumn.
 boolean getDragEnabled sample code for javax.swing.JTable.getDragEnabled() definition code for javax.swing.JTable.getDragEnabled() ()
          Gets the value of the dragEnabled property.
 int getEditingColumn sample code for javax.swing.JTable.getEditingColumn() definition code for javax.swing.JTable.getEditingColumn() ()
          Returns the index of the column that contains the cell currently being edited.
 int getEditingRow sample code for javax.swing.JTable.getEditingRow() definition code for javax.swing.JTable.getEditingRow() ()
          Returns the index of the row that contains the cell currently being edited.
 Component sample code for java.awt.Component definition code for java.awt.Component getEditorComponent sample code for javax.swing.JTable.getEditorComponent() definition code for javax.swing.JTable.getEditorComponent() ()
          Returns the component that is handling the editing session.
 Color sample code for java.awt.Color definition code for java.awt.Color getGridColor sample code for javax.swing.JTable.getGridColor() definition code for javax.swing.JTable.getGridColor() ()
          Returns the color used to draw grid lines.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getIntercellSpacing sample code for javax.swing.JTable.getIntercellSpacing() definition code for javax.swing.JTable.getIntercellSpacing() ()
          Returns the horizontal and vertical space between cells.
 TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel getModel sample code for javax.swing.JTable.getModel() definition code for javax.swing.JTable.getModel() ()
          Returns the TableModel that provides the data displayed by this JTable.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getPreferredScrollableViewportSize sample code for javax.swing.JTable.getPreferredScrollableViewportSize() definition code for javax.swing.JTable.getPreferredScrollableViewportSize() ()
          Returns the preferred size of the viewport for this table.
 Printable sample code for java.awt.print.Printable definition code for java.awt.print.Printable getPrintable 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) (JTable.PrintMode sample code for javax.swing.JTable.PrintMode definition code for javax.swing.JTable.PrintMode  printMode, MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  headerFormat, MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  footerFormat)
          Return a Printable for use in printing this JTable.
 int getRowCount sample code for javax.swing.JTable.getRowCount() definition code for javax.swing.JTable.getRowCount() ()
          Returns the number of rows in this table's model.
 int getRowHeight sample code for javax.swing.JTable.getRowHeight() definition code for javax.swing.JTable.getRowHeight() ()
          Returns the height of a table row, in pixels.
 int getRowHeight sample code for javax.swing.JTable.getRowHeight(int) definition code for javax.swing.JTable.getRowHeight(int) (int row)
          Returns the height, in pixels, of the cells in row.
 int getRowMargin sample code for javax.swing.JTable.getRowMargin() definition code for javax.swing.JTable.getRowMargin() ()
          Gets the amount of empty space, in pixels, between cells.
 boolean getRowSelectionAllowed sample code for javax.swing.JTable.getRowSelectionAllowed() definition code for javax.swing.JTable.getRowSelectionAllowed() ()
          Returns true if rows can be selected.
 int getScrollableBlockIncrement sample code for javax.swing.JTable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.JTable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect, int orientation, int direction)
          Returns visibleRect.height or visibleRect.width, depending on this table's orientation.
 boolean getScrollableTracksViewportHeight sample code for javax.swing.JTable.getScrollableTracksViewportHeight() definition code for javax.swing.JTable.getScrollableTracksViewportHeight() ()
          Returns false to indicate that the height of the viewport does not determine the height of the table.
 boolean getScrollableTracksViewportWidth sample code for javax.swing.JTable.getScrollableTracksViewportWidth() definition code for javax.swing.JTable.getScrollableTracksViewportWidth() ()
          Returns false if autoResizeMode is set to AUTO_RESIZE_OFF, which indicates that the width of the viewport does not determine the width of the table.
 int getScrollableUnitIncrement sample code for javax.swing.JTable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.JTable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect, int orientation, int direction)
          Returns the scroll increment (in pixels) that completely exposes one new row or column (depending on the orientation).
 int getSelectedColumn sample code for javax.swing.JTable.getSelectedColumn() definition code for javax.swing.JTable.getSelectedColumn() ()
          Returns the index of the first selected column, -1 if no column is selected.
 int getSelectedColumnCount sample code for javax.swing.JTable.getSelectedColumnCount() definition code for javax.swing.JTable.getSelectedColumnCount() ()
          Returns the number of selected columns.
 int[] getSelectedColumns sample code for javax.swing.JTable.getSelectedColumns() definition code for javax.swing.JTable.getSelectedColumns() ()
          Returns the indices of all selected columns.
 int getSelectedRow sample code for javax.swing.JTable.getSelectedRow() definition code for javax.swing.JTable.getSelectedRow() ()
          Returns the index of the first selected row, -1 if no row is selected.
 int getSelectedRowCount sample code for javax.swing.JTable.getSelectedRowCount() definition code for javax.swing.JTable.getSelectedRowCount() ()
          Returns the number of selected rows.
 int[] getSelectedRows sample code for javax.swing.JTable.getSelectedRows() definition code for javax.swing.JTable.getSelectedRows() ()
          Returns the indices of all selected rows.
 Color sample code for java.awt.Color definition code for java.awt.Color getSelectionBackground sample code for javax.swing.JTable.getSelectionBackground() definition code for javax.swing.JTable.getSelectionBackground() ()
          Returns the background color for selected cells.
 Color sample code for java.awt.Color definition code for java.awt.Color getSelectionForeground sample code for javax.swing.JTable.getSelectionForeground() definition code for javax.swing.JTable.getSelectionForeground() ()
          Returns the foreground color for selected cells.
 ListSelectionModel sample code for javax.swing.ListSelectionModel definition code for javax.swing.ListSelectionModel getSelectionModel sample code for javax.swing.JTable.getSelectionModel() definition code for javax.swing.JTable.getSelectionModel() ()
          Returns the ListSelectionModel that is used to maintain row selection state.
 boolean getShowHorizontalLines sample code for javax.swing.JTable.getShowHorizontalLines() definition code for javax.swing.JTable.getShowHorizontalLines() ()
          Returns true if the table draws horizontal lines between cells, false if it doesn't.
 boolean getShowVerticalLines sample code for javax.swing.JTable.getShowVerticalLines() definition code for javax.swing.JTable.getShowVerticalLines() ()
          Returns true if the table draws vertical lines between cells, false if it doesn't.
 boolean getSurrendersFocusOnKeystroke sample code for javax.swing.JTable.getSurrendersFocusOnKeystroke() definition code for javax.swing.JTable.getSurrendersFocusOnKeystroke() ()
          Returns true if the editor should get the focus when keystrokes cause the editor to be activated
 JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader getTableHeader sample code for javax.swing.JTable.getTableHeader() definition code for javax.swing.JTable.getTableHeader() ()
          Returns the tableHeader used by this JTable.
 String sample code for java.lang.String definition code for java.lang.String getToolTipText sample code for javax.swing.JTable.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JTable.getToolTipText(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
          Overrides JComponent's getToolTipText method in order to allow the renderer's tips to be used if it has text set.
 TableUI sample code for javax.swing.plaf.TableUI definition code for javax.swing.plaf.TableUI getUI sample code for javax.swing.JTable.getUI() definition code for javax.swing.JTable.getUI() ()
          Returns the L&F object that renders this component.
 String sample code for java.lang.String definition code for java.lang.String getUIClassID sample code for javax.swing.JTable.getUIClassID() definition code for javax.swing.JTable.getUIClassID() ()
          Returns the suffix used to construct the name of the L&F class used to render this component.
 Object sample code for java.lang.Object definition code for java.lang.Object getValueAt sample code for javax.swing.JTable.getValueAt(int, int) definition code for javax.swing.JTable.getValueAt(int, int) (int row, int column)
          Returns the cell value at row and column.
protected  void initializeLocalVars sample code for javax.swing.JTable.initializeLocalVars() definition code for javax.swing.JTable.initializeLocalVars() ()
          Initializes table properties to their default values.
 boolean isCellEditable sample code for javax.swing.JTable.isCellEditable(int, int) definition code for javax.swing.JTable.isCellEditable(int, int) (int row, int column)
          Returns true if the cell at row and column is editable.
 boolean isCellSelected sample code for javax.swing.JTable.isCellSelected(int, int) definition code for javax.swing.JTable.isCellSelected(int, int) (int row, int column)
          Returns true if the specified indices are in the valid range of rows and columns and the cell at the specified position is selected.
 boolean isColumnSelected sample code for javax.swing.JTable.isColumnSelected(int) definition code for javax.swing.JTable.isColumnSelected(int) (int column)
          Returns true if the specified index is in the valid range of columns, and the column at that index is selected.
 boolean isEditing sample code for javax.swing.JTable.isEditing() definition code for javax.swing.JTable.isEditing() ()
          Returns true if a cell is being edited.
 boolean isRowSelected sample code for javax.swing.JTable.isRowSelected(int) definition code for javax.swing.JTable.isRowSelected(int) (int row)
          Returns true if the specified index is in the valid range of rows, and the row at that index is selected.
 void moveColumn sample code for javax.swing.JTable.moveColumn(int, int) definition code for javax.swing.JTable.moveColumn(int, int) (int column, int targetColumn)
          Moves the column column to the position currently occupied by the column targetColumn in the view.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for javax.swing.JTable.paramString() definition code for javax.swing.JTable.paramString() ()
          Returns a string representation of this table.
 Component sample code for java.awt.Component definition code for java.awt.Component prepareEditor sample code for javax.swing.JTable.prepareEditor(javax.swing.table.TableCellEditor, int, int) definition code for javax.swing.JTable.prepareEditor(javax.swing.table.TableCellEditor, int, int) (TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  editor, int row, int column)
          Prepares the editor by querying the data model for the value and selection state of the cell at row, column.
 Component sample code for java.awt.Component definition code for java.awt.Component prepareRenderer sample code for javax.swing.JTable.prepareRenderer(javax.swing.table.TableCellRenderer, int, int) definition code for javax.swing.JTable.prepareRenderer(javax.swing.table.TableCellRenderer, int, int) (TableCellRenderer sample code for javax.swing.table.TableCellRenderer definition code for javax.swing.table.TableCellRenderer  renderer, int row, int column)
          Prepares the renderer by querying the data model for the value and selection state of the cell at row, column.
 boolean print sample code for javax.swing.JTable.print() definition code for javax.swing.JTable.print() ()
          A convenience method that displays a printing dialog, and then prints this JTable in mode PrintMode.FIT_WIDTH, with no header or footer text.
 boolean print sample code for javax.swing.JTable.print(javax.swing.JTable.PrintMode) definition code for javax.swing.JTable.print(javax.swing.JTable.PrintMode) (JTable.PrintMode sample code for javax.swing.JTable.PrintMode definition code for javax.swing.JTable.PrintMode  printMode)
          A convenience method that displays a printing dialog, and then prints this JTable in the given printing mode, with no header or footer text.
 boolean print sample code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat) definition code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat) (JTable.PrintMode sample code for javax.swing.JTable.PrintMode definition code for javax.swing.JTable.PrintMode  printMode, MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  headerFormat, MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  footerFormat)
          A convenience method that displays a printing dialog, and then prints this JTable in the given printing mode, with the specified header and footer text.
 boolean print sample code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) definition code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) (JTable.PrintMode sample code for javax.swing.JTable.PrintMode definition code for javax.swing.JTable.PrintMode  printMode, MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  headerFormat, MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  footerFormat, boolean showPrintDialog, PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet  attr, boolean interactive)
          Print this JTable.
protected  boolean processKeyBinding sample code for javax.swing.JTable.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JTable.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) (KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  ks, KeyEvent sample code for java.awt.event.KeyEvent definition code for java.awt.event.KeyEvent  e, int condition, boolean pressed)
          Invoked to process the key bindings for ks as the result of the KeyEvent e.
 void removeColumn sample code for javax.swing.JTable.removeColumn(javax.swing.table.TableColumn) definition code for javax.swing.JTable.removeColumn(javax.swing.table.TableColumn) (TableColumn sample code for javax.swing.table.TableColumn definition code for javax.swing.table.TableColumn  aColumn)
          Removes aColumn from this JTable's array of columns.
 void removeColumnSelectionInterval sample code for javax.swing.JTable.removeColumnSelectionInterval(int, int) definition code for javax.swing.JTable.removeColumnSelectionInterval(int, int) (int index0, int index1)
          Deselects the columns from index0 to index1, inclusive.
 void removeEditor sample code for javax.swing.JTable.removeEditor() definition code for javax.swing.JTable.removeEditor() ()
          Discards the editor object and frees the real estate it used for cell rendering.
 void removeNotify sample code for javax.swing.JTable.removeNotify() definition code for javax.swing.JTable.removeNotify() ()
          Calls the unconfigureEnclosingScrollPane method.
 void removeRowSelectionInterval sample code for javax.swing.JTable.removeRowSelectionInterval(int, int) definition code for javax.swing.JTable.removeRowSelectionInterval(int, int) (int index0, int index1)
          Deselects the rows from index0 to index1, inclusive.
protected  void resizeAndRepaint sample code for javax.swing.JTable.resizeAndRepaint() definition code for javax.swing.JTable.resizeAndRepaint() ()
          Equivalent to revalidate followed by repaint.
 int rowAtPoint sample code for javax.swing.JTable.rowAtPoint(java.awt.Point) definition code for javax.swing.JTable.rowAtPoint(java.awt.Point) (Point sample code for java.awt.Point definition code for java.awt.Point  point)
          Returns the index of the row that point lies in, or -1 if the result is not in the range [0, getRowCount()-1].
 void selectAll sample code for javax.swing.JTable.selectAll() definition code for javax.swing.JTable.selectAll() ()
          Selects all rows, columns, and cells in the table.
 void setAutoCreateColumnsFromModel sample code for javax.swing.JTable.setAutoCreateColumnsFromModel(boolean) definition code for javax.swing.JTable.setAutoCreateColumnsFromModel(boolean) (boolean autoCreateColumnsFromModel)
          Sets this table's autoCreateColumnsFromModel flag.
 void setAutoResizeMode sample code for javax.swing.JTable.setAutoResizeMode(int) definition code for javax.swing.JTable.setAutoResizeMode(int) (int mode)
          Sets the table's auto resize mode when the table is resized.
 void setCellEditor sample code for javax.swing.JTable.setCellEditor(javax.swing.table.TableCellEditor) definition code for javax.swing.JTable.setCellEditor(javax.swing.table.TableCellEditor) (TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  anEditor)
          Sets the cellEditor variable.
 void setCellSelectionEnabled sample code for javax.swing.JTable.setCellSelectionEnabled(boolean) definition code for javax.swing.JTable.setCellSelectionEnabled(boolean) (boolean cellSelectionEnabled)
          Sets whether this table allows both a column selection and a row selection to exist simultaneously.
 void setColumnModel sample code for javax.swing.JTable.setColumnModel(javax.swing.table.TableColumnModel) definition code for javax.swing.JTable.setColumnModel(javax.swing.table.TableColumnModel) (TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel  columnModel)
          Sets the column model for this table to newModel and registers for listener notifications from the new column model.
 void setColumnSelectionAllowed sample code for javax.swing.JTable.setColumnSelectionAllowed(boolean) definition code for javax.swing.JTable.setColumnSelectionAllowed(boolean) (boolean columnSelectionAllowed)
          Sets whether the columns in this model can be selected.
 void setColumnSelectionInterval sample code for javax.swing.JTable.setColumnSelectionInterval(int, int) definition code for javax.swing.JTable.setColumnSelectionInterval(int, int) (int index0, int index1)
          Selects the columns from index0 to index1, inclusive.
 void setDefaultEditor sample code for javax.swing.JTable.setDefaultEditor(java.lang.Class, javax.swing.table.TableCellEditor) definition code for javax.swing.JTable.setDefaultEditor(java.lang.Class, javax.swing.table.TableCellEditor) (Class sample code for java.lang.Class definition code for java.lang.Class <?> columnClass, TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  editor)
          Sets a default cell editor to be used if no editor has been set in a TableColumn.
 void setDefaultRenderer sample code for javax.swing.JTable.setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer) definition code for javax.swing.JTable.setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer) (Class sample code for java.lang.Class definition code for java.lang.Class <?> columnClass, TableCellRenderer sample code for javax.swing.table.TableCellRenderer definition code for javax.swing.table.TableCellRenderer  renderer)
          Sets a default cell renderer to be used if no renderer has been set in a TableColumn.
 void setDragEnabled sample code for javax.swing.JTable.setDragEnabled(boolean) definition code for javax.swing.JTable.setDragEnabled(boolean) (boolean b)
          Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component.
 void setEditingColumn sample code for javax.swing.JTable.setEditingColumn(int) definition code for javax.swing.JTable.setEditingColumn(int) (int aColumn)
          Sets the editingColumn variable.
 void setEditingRow sample code for javax.swing.JTable.setEditingRow(int) definition code for javax.swing.JTable.setEditingRow(int) (int aRow)
          Sets the editingRow variable.
 void setGridColor sample code for javax.swing.JTable.setGridColor(java.awt.Color) definition code for javax.swing.JTable.setGridColor(java.awt.Color) (Color sample code for java.awt.Color definition code for java.awt.Color  gridColor)
          Sets the color used to draw grid lines to gridColor and redisplays.
 void setIntercellSpacing sample code for javax.swing.JTable.setIntercellSpacing(java.awt.Dimension) definition code for javax.swing.JTable.setIntercellSpacing(java.awt.Dimension) (Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  intercellSpacing)
          Sets the rowMargin and the columnMargin -- the height and width of the space between cells -- to intercellSpacing.
 void setModel sample code for javax.swing.JTable.setModel(javax.swing.table.TableModel) definition code for javax.swing.JTable.setModel(javax.swing.table.TableModel) (TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel  dataModel)
          Sets the data model for this table to newModel and registers with it for listener notifications from the new data model.
 void setPreferredScrollableViewportSize sample code for javax.swing.JTable.setPreferredScrollableViewportSize(java.awt.Dimension) definition code for javax.swing.JTable.setPreferredScrollableViewportSize(java.awt.Dimension) (Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  size)
          Sets the preferred size of the viewport for this table.
 void setRowHeight sample code for javax.swing.JTable.setRowHeight(int) definition code for javax.swing.JTable.setRowHeight(int) (int rowHeight)
          Sets the height, in pixels, of all cells to rowHeight, revalidates, and repaints.
 void setRowHeight sample code for javax.swing.JTable.setRowHeight(int, int) definition code for javax.swing.JTable.setRowHeight(int, int) (int row, int rowHeight)
          Sets the height for row to rowHeight, revalidates, and repaints.
 void setRowMargin sample code for javax.swing.JTable.setRowMargin(int) definition code for javax.swing.JTable.setRowMargin(int) (int rowMargin)
          Sets the amount of empty space between cells in adjacent rows.
 void setRowSelectionAllowed sample code for javax.swing.JTable.setRowSelectionAllowed(boolean) definition code for javax.swing.JTable.setRowSelectionAllowed(boolean) (boolean rowSelectionAllowed)
          Sets whether the rows in this model can be selected.
 void setRowSelectionInterval sample code for javax.swing.JTable.setRowSelectionInterval(int, int) definition code for javax.swing.JTable.setRowSelectionInterval(int, int) (int index0, int index1)
          Selects the rows from index0 to index1, inclusive.
 void setSelectionBackground sample code for javax.swing.JTable.setSelectionBackground(java.awt.Color) definition code for javax.swing.JTable.setSelectionBackground(java.awt.Color) (Color sample code for java.awt.Color definition code for java.awt.Color  selectionBackground)
          Sets the background color for selected cells.
 void setSelectionForeground sample code for javax.swing.JTable.setSelectionForeground(java.awt.Color) definition code for javax.swing.JTable.setSelectionForeground(java.awt.Color) (Color sample code for java.awt.Color definition code for java.awt.Color  selectionForeground)
          Sets the foreground color for selected cells.
 void setSelectionMode sample code for javax.swing.JTable.setSelectionMode(int) definition code for javax.swing.JTable.setSelectionMode(int) (int selectionMode)
          Sets the table's selection mode to allow only single selections, a single contiguous interval, or multiple intervals.
 void setSelectionModel sample code for javax.swing.JTable.setSelectionModel(javax.swing.ListSelectionModel) definition code for javax.swing.JTable.setSelectionModel(javax.swing.ListSelectionModel) (ListSelectionModel sample code for javax.swing.ListSelectionModel definition code for javax.swing.ListSelectionModel  newModel)
          Sets the row selection model for this table to newModel and registers for listener notifications from the new selection model.
 void setShowGrid sample code for javax.swing.JTable.setShowGrid(boolean) definition code for javax.swing.JTable.setShowGrid(boolean) (boolean showGrid)
          Sets whether the table draws grid lines around cells.
 void setShowHorizontalLines sample code for javax.swing.JTable.setShowHorizontalLines(boolean) definition code for javax.swing.JTable.setShowHorizontalLines(boolean) (boolean showHorizontalLines)
          Sets whether the table draws horizontal lines between cells.
 void setShowVerticalLines sample code for javax.swing.JTable.setShowVerticalLines(boolean) definition code for javax.swing.JTable.setShowVerticalLines(boolean) (boolean showVerticalLines)
          Sets whether the table draws vertical lines between cells.
 void setSurrendersFocusOnKeystroke sample code for javax.swing.JTable.setSurrendersFocusOnKeystroke(boolean) definition code for javax.swing.JTable.setSurrendersFocusOnKeystroke(boolean) (boolean surrendersFocusOnKeystroke)
          Sets whether editors in this JTable get the keyboard focus when an editor is activated as a result of the JTable forwarding keyboard events for a cell.
 void setTableHeader sample code for javax.swing.JTable.setTableHeader(javax.swing.table.JTableHeader) definition code for javax.swing.JTable.setTableHeader(javax.swing.table.JTableHeader) (JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader  tableHeader)
          Sets the tableHeader working with this JTable to newHeader.
 void setUI sample code for javax.swing.JTable.setUI(javax.swing.plaf.TableUI) definition code for javax.swing.JTable.setUI(javax.swing.plaf.TableUI) (TableUI sample code for javax.swing.plaf.TableUI definition code for javax.swing.plaf.TableUI  ui)
          Sets the L&F object that renders this component and repaints.
 void setValueAt sample code for javax.swing.JTable.setValueAt(java.lang.Object, int, int) definition code for javax.swing.JTable.setValueAt(java.lang.Object, int, int) (Object sample code for java.lang.Object definition code for java.lang.Object  aValue, int row, int column)
          Sets the value for the cell in the table model at row and column.
 void sizeColumnsToFit sample code for javax.swing.JTable.sizeColumnsToFit(boolean) definition code for javax.swing.JTable.sizeColumnsToFit(boolean) (boolean lastColumnOnly)
          Deprecated. As of Swing version 1.0.3, replaced by doLayout().
 void sizeColumnsToFit sample code for javax.swing.JTable.sizeColumnsToFit(int) definition code for javax.swing.JTable.sizeColumnsToFit(int) (int resizingColumn)
          Obsolete as of Java 2 platform v1.4.
 void tableChanged sample code for javax.swing.JTable.tableChanged(javax.swing.event.TableModelEvent) definition code for javax.swing.JTable.tableChanged(javax.swing.event.TableModelEvent) (TableModelEvent sample code for javax.swing.event.TableModelEvent definition code for javax.swing.event.TableModelEvent  e)
          Invoked when this table's TableModel generates a TableModelEvent.
protected  void unconfigureEnclosingScrollPane sample code for javax.swing.JTable.unconfigureEnclosingScrollPane() definition code for javax.swing.JTable.unconfigureEnclosingScrollPane() ()
          Reverses the effect of configureEnclosingScrollPane by replacing the columnHeaderView of the enclosing scroll pane with null.
 void updateUI sample code for javax.swing.JTable.updateUI() definition code for javax.swing.JTable.updateUI() ()
          Notification from the UIManager that the L&F has changed.
 void valueChanged sample code for javax.swing.JTable.valueChanged(javax.swing.event.ListSelectionEvent) definition code for javax.swing.JTable.valueChanged(javax.swing.event.ListSelectionEvent) (ListSelectionEvent sample code for javax.swing.event.ListSelectionEvent definition code for javax.swing.event.ListSelectionEvent  e)
          Invoked when the row selection changes -- repaints to show the new selection.
 
Methods inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
addAncestorListener sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) , addVetoableChangeListener sample code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) , computeVisibleRect sample code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) definition code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) , contains sample code for javax.swing.JComponent.contains(int, int) definition code for javax.swing.JComponent.contains(int, int) , createToolTip sample code for javax.swing.JComponent.createToolTip() definition code for javax.swing.JComponent.createToolTip() , disable sample code for javax.swing.JComponent.disable() definition code for javax.swing.JComponent.disable() , enable sample code for javax.swing.JComponent.enable() definition code for javax.swing.JComponent.enable() , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) , fireVetoableChange sample code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) , getActionForKeyStroke sample code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) , getActionMap sample code for javax.swing.JComponent.getActionMap() definition code for javax.swing.JComponent.getActionMap() , getAlignmentX sample code for javax.swing.JComponent.getAlignmentX() definition code for javax.swing.JComponent.getAlignmentX() , getAlignmentY sample code for javax.swing.JComponent.getAlignmentY() definition code for javax.swing.JComponent.getAlignmentY() , getAncestorListeners sample code for javax.swing.JComponent.getAncestorListeners() definition code for javax.swing.JComponent.getAncestorListeners() , getAutoscrolls sample code for javax.swing.JComponent.getAutoscrolls() definition code for javax.swing.JComponent.getAutoscrolls() , getBorder sample code for javax.swing.JComponent.getBorder() definition code for javax.swing.JComponent.getBorder() , getBounds sample code for javax.swing.JComponent.getBounds(java.awt.Rectangle) definition code for javax.swing.JComponent.getBounds(java.awt.Rectangle) , getClientProperty sample code for javax.swing.JComponent.getClientProperty(java.lang.Object) definition code for javax.swing.JComponent.getClientProperty(java.lang.Object) , getComponentGraphics sample code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) definition code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) , getComponentPopupMenu sample code for javax.swing.JComponent.getComponentPopupMenu() definition code for javax.swing.JComponent.getComponentPopupMenu() , getConditionForKeyStroke sample code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) , getDebugGraphicsOptions sample code for javax.swing.JComponent.getDebugGraphicsOptions() definition code for javax.swing.JComponent.getDebugGraphicsOptions() , getDefaultLocale sample code for javax.swing.JComponent.getDefaultLocale() definition code for javax.swing.JComponent.getDefaultLocale() , getFontMetrics sample code for javax.swing.JComponent.getFontMetrics(java.awt.Font) definition code for javax.swing.JComponent.getFontMetrics(java.awt.Font) , getGraphics sample code for javax.swing.JComponent.getGraphics() definition code for javax.swing.JComponent.getGraphics() , getHeight sample code for javax.swing.JComponent.getHeight() definition code for javax.swing.JComponent.getHeight() , getInheritsPopupMenu sample code for javax.swing.JComponent.getInheritsPopupMenu() definition code for javax.swing.JComponent.getInheritsPopupMenu() , getInputMap sample code for javax.swing.JComponent.getInputMap() definition code for javax.swing.JComponent.getInputMap() , getInputMap sample code for javax.swing.JComponent.getInputMap(int) definition code for javax.swing.JComponent.getInputMap(int) , getInputVerifier sample code for javax.swing.JComponent.getInputVerifier() definition code for javax.swing.JComponent.getInputVerifier() , getInsets sample code for javax.swing.JComponent.getInsets() definition code for javax.swing.JComponent.getInsets() , getInsets sample code for javax.swing.JComponent.getInsets(java.awt.Insets) definition code for javax.swing.JComponent.getInsets(java.awt.Insets) , getListeners sample code for javax.swing.JComponent.getListeners(java.lang.Class) definition code for javax.swing.JComponent.getListeners(java.lang.Class) , getLocation sample code for javax.swing.JComponent.getLocation(java.awt.Point) definition code for javax.swing.JComponent.getLocation(java.awt.Point) , getMaximumSize sample code for javax.swing.JComponent.getMaximumSize() definition code for javax.swing.JComponent.getMaximumSize() , getMinimumSize sample code for javax.swing.JComponent.getMinimumSize() definition code for javax.swing.JComponent.getMinimumSize() , getNextFocusableComponent sample code for javax.swing.JComponent.getNextFocusableComponent() definition code for javax.swing.JComponent.getNextFocusableComponent() , getPopupLocation sample code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) , getPreferredSize sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize() , getRegisteredKeyStrokes sample code for javax.swing.JComponent.getRegisteredKeyStrokes() definition code for javax.swing.JComponent.getRegisteredKeyStrokes() , getRootPane sample code for javax.swing.JComponent.getRootPane() definition code for javax.swing.JComponent.getRootPane() , getSize sample code for javax.swing.JComponent.getSize(java.awt.Dimension) definition code for javax.swing.JComponent.getSize(java.awt.Dimension) , getToolTipLocation sample code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) , getToolTipText sample code for javax.swing.JComponent.getToolTipText() definition code for javax.swing.JComponent.getToolTipText() , getTopLevelAncestor sample code for javax.swing.JComponent.getTopLevelAncestor() definition code for javax.swing.JComponent.getTopLevelAncestor() , getTransferHandler sample code for javax.swing.JComponent.getTransferHandler() definition code for javax.swing.JComponent.getTransferHandler() , getVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() definition code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() , getVetoableChangeListeners sample code for javax.swing.JComponent.getVetoableChangeListeners() definition code for javax.swing.JComponent.getVetoableChangeListeners() , getVisibleRect sample code for javax.swing.JComponent.getVisibleRect() definition code for javax.swing.JComponent.getVisibleRect() , getWidth sample code for javax.swing.JComponent.getWidth() definition code for javax.swing.JComponent.getWidth() , getX sample code for javax.swing.JComponent.getX() definition code for javax.swing.JComponent.getX() , getY sample code for javax.swing.JComponent.getY() definition code for javax.swing.JComponent.getY() , grabFocus sample code for javax.swing.JComponent.grabFocus() definition code for javax.swing.JComponent.grabFocus() , isDoubleBuffered sample code for javax.swing.JComponent.isDoubleBuffered() definition code for javax.swing.JComponent.isDoubleBuffered() , isLightweightComponent sample code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) definition code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) , isManagingFocus sample code for javax.swing.JComponent.isManagingFocus() definition code for javax.swing.JComponent.isManagingFocus() , isOpaque sample code for javax.swing.JComponent.isOpaque() definition code for javax.swing.JComponent.isOpaque() , isOptimizedDrawingEnabled sample code for javax.swing.JComponent.isOptimizedDrawingEnabled() definition code for javax.swing.JComponent.isOptimizedDrawingEnabled() , isPaintingTile sample code for javax.swing.JComponent.isPaintingTile() definition code for javax.swing.JComponent.isPaintingTile() , isRequestFocusEnabled sample code for javax.swing.JComponent.isRequestFocusEnabled() definition code for javax.swing.JComponent.isRequestFocusEnabled() , isValidateRoot sample code for javax.swing.JComponent.isValidateRoot() definition code for javax.swing.JComponent.isValidateRoot() , paint sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) , paintBorder sample code for javax.swing.JComponent.paintBorder(java.awt.Graphics) definition code for javax.swing.JComponent.paintBorder(java.awt.Graphics) , paintChildren sample code for javax.swing.JComponent.paintChildren(java.awt.Graphics) definition code for javax.swing.JComponent.paintChildren(java.awt.Graphics) , paintComponent sample code for javax.swing.JComponent.paintComponent(java.awt.Graphics) definition code for javax.swing.JComponent.paintComponent(java.awt.Graphics) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(int, int, int, int) definition code for javax.swing.JComponent.paintImmediately(int, int, int, int) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) definition code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) , print sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics) , printAll sample code for javax.swing.JComponent.printAll(java.awt.Graphics) definition code for javax.swing.JComponent.printAll(java.awt.Graphics) , printBorder sample code for javax.swing.JComponent.printBorder(java.awt.Graphics) definition code for javax.swing.JComponent.printBorder(java.awt.Graphics) , printChildren sample code for javax.swing.JComponent.printChildren(java.awt.Graphics) definition code for javax.swing.JComponent.printChildren(java.awt.Graphics) , printComponent sample code for javax.swing.JComponent.printComponent(java.awt.Graphics) definition code for javax.swing.JComponent.printComponent(java.awt.Graphics) , processComponentKeyEvent sample code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) , processKeyEvent sample code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) , processMouseEvent sample code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) , processMouseMotionEvent sample code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) , putClientProperty sample code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) , removeAncestorListener sample code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) , removeVetoableChangeListener sample code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) , repaint sample code for javax.swing.JComponent.repaint(long, int, int, int, int) definition code for javax.swing.JComponent.repaint(long, int, int, int, int) , repaint sample code for javax.swing.JComponent.repaint(java.awt.Rectangle) definition code for javax.swing.JComponent.repaint(java.awt.Rectangle) , requestDefaultFocus sample code for javax.swing.JComponent.requestDefaultFocus() definition code for javax.swing.JComponent.requestDefaultFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus() definition code for javax.swing.JComponent.requestFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus(boolean) definition code for javax.swing.JComponent.requestFocus(boolean) , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow() definition code for javax.swing.JComponent.requestFocusInWindow() , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow(boolean) definition code for javax.swing.JComponent.requestFocusInWindow(boolean) , resetKeyboardActions sample code for javax.swing.JComponent.resetKeyboardActions() definition code for javax.swing.JComponent.resetKeyboardActions() , reshape sample code for javax.swing.JComponent.reshape(int, int, int, int) definition code for javax.swing.JComponent.reshape(int, int, int, int) , revalidate sample code for javax.swing.JComponent.revalidate() definition code for javax.swing.JComponent.revalidate() , scrollRectToVisible sample code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) definition code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) , setActionMap sample code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) definition code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) , setAlignmentX sample code for javax.swing.JComponent.setAlignmentX(float) definition code for javax.swing.JComponent.setAlignmentX(float) , setAlignmentY sample code for javax.swing.JComponent.setAlignmentY(float) definition code for javax.swing.JComponent.setAlignmentY(float) , setAutoscrolls sample code for javax.swing.JComponent.setAutoscrolls(boolean) definition code for javax.swing.JComponent.setAutoscrolls(boolean) , setBackground sample code for javax.swing.JComponent.setBackground(java.awt.Color) definition code for javax.swing.JComponent.setBackground(java.awt.Color) , setBorder sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border) , setComponentPopupMenu sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) , setDebugGraphicsOptions sample code for javax.swing.JComponent.setDebugGraphicsOptions(int) definition code for javax.swing.JComponent.setDebugGraphicsOptions(int) , setDefaultLocale sample code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) definition code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) , setDoubleBuffered sample code for javax.swing.JComponent.setDoubleBuffered(boolean) definition code for javax.swing.JComponent.setDoubleBuffered(boolean) , setEnabled sample code for javax.swing.JComponent.setEnabled(boolean) definition code for javax.swing.JComponent.setEnabled(boolean) , setFocusTraversalKeys sample code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) definition code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) , setFont sample code for javax.swing.JComponent.setFont(java.awt.Font) definition code for javax.swing.JComponent.setFont(java.awt.Font) , setForeground sample code for javax.swing.JComponent.setForeground(java.awt.Color) definition code for javax.swing.JComponent.setForeground(java.awt.Color) , setInheritsPopupMenu sample code for javax.swing.JComponent.setInheritsPopupMenu(boolean) definition code for javax.swing.JComponent.setInheritsPopupMenu(boolean) , setInputMap sample code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) definition code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) , setInputVerifier sample code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) definition code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) , setMaximumSize sample code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) , setMinimumSize sample code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) , setNextFocusableComponent sample code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) definition code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) , setOpaque sample code for javax.swing.JComponent.setOpaque(boolean) definition code for javax.swing.JComponent.setOpaque(boolean) , setPreferredSize sample code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) definition code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) , setRequestFocusEnabled sample code for javax.swing.JComponent.setRequestFocusEnabled(boolean) definition code for javax.swing.JComponent.setRequestFocusEnabled(boolean) , setToolTipText sample code for javax.swing.JComponent.setToolTipText(java.lang.String) definition code for javax.swing.JComponent.setToolTipText(java.lang.String) , setTransferHandler sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) , setUI sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) , setVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) definition code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) , setVisible sample code for javax.swing.JComponent.setVisible(boolean) definition code for javax.swing.JComponent.setVisible(boolean) , unregisterKeyboardAction sample code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) definition code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) , update sample code for javax.swing.JComponent.update(java.awt.Graphics) definition code for javax.swing.JComponent.update(java.awt.Graphics)
 
Methods inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
add sample code for java.awt.Container.add(java.awt.Component) definition code for java.awt.Container.add(java.awt.Component) , add sample code for java.awt.Container.add(java.awt.Component, int) definition code for java.awt.Container.add(java.awt.Component, int) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) , add sample code for java.awt.Container.add(java.lang.String, java.awt.Component) definition code for java.awt.Container.add(java.lang.String, java.awt.Component) , addContainerListener sample code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) , addImpl sample code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , applyComponentOrientation sample code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) , areFocusTraversalKeysSet sample code for java.awt.Container.areFocusTraversalKeysSet(int) definition code for java.awt.Container.areFocusTraversalKeysSet(int) , countComponents sample code for java.awt.Container.countComponents() definition code for java.awt.Container.countComponents() , deliverEvent sample code for java.awt.Container.deliverEvent(java.awt.Event) definition code for java.awt.Container.deliverEvent(java.awt.Event) , findComponentAt sample code for java.awt.Container.findComponentAt(int, int) definition code for java.awt.Container.findComponentAt(int, int) , findComponentAt sample code for java.awt.Container.findComponentAt(java.awt.Point) definition code for java.awt.Container.findComponentAt(java.awt.Point) , getComponent sample code for java.awt.Container.getComponent(int) definition code for java.awt.Container.getComponent(int) , getComponentAt sample code for java.awt.Container.getComponentAt(int, int) definition code for java.awt.Container.getComponentAt(int, int) , getComponentAt sample code for java.awt.Container.getComponentAt(java.awt.Point) definition code for java.awt.Container.getComponentAt(java.awt.Point) , getComponentCount sample code for java.awt.Container.getComponentCount() definition code for java.awt.Container.getComponentCount() , getComponents sample code for java.awt.Container.getComponents() definition code for java.awt.Container.getComponents() , getComponentZOrder sample code for java.awt.Container.getComponentZOrder(java.awt.Component) definition code for java.awt.Container.getComponentZOrder(java.awt.Component) , getContainerListeners sample code for java.awt.Container.getContainerListeners() definition code for java.awt.Container.getContainerListeners() , getFocusTraversalKeys sample code for java.awt.Container.getFocusTraversalKeys(int) definition code for java.awt.Container.getFocusTraversalKeys(int) , getFocusTraversalPolicy sample code for java.awt.Container.getFocusTraversalPolicy() definition code for java.awt.Container.getFocusTraversalPolicy() , getLayout sample code for java.awt.Container.getLayout() definition code for java.awt.Container.getLayout() , getMousePosition sample code for java.awt.Container.getMousePosition(boolean) definition code for java.awt.Container.getMousePosition(boolean) , insets sample code for java.awt.Container.insets() definition code for java.awt.Container.insets() , invalidate sample code for java.awt.Container.invalidate() definition code for java.awt.Container.invalidate() , isAncestorOf sample code for java.awt.Container.isAncestorOf(java.awt.Component) definition code for java.awt.Container.isAncestorOf(java.awt.Component) , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot() definition code for java.awt.Container.isFocusCycleRoot() , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot(java.awt.Container) definition code for java.awt.Container.isFocusCycleRoot(java.awt.Container) , isFocusTraversalPolicyProvider sample code for java.awt.Container.isFocusTraversalPolicyProvider() definition code for java.awt.Container.isFocusTraversalPolicyProvider() , isFocusTraversalPolicySet sample code for java.awt.Container.isFocusTraversalPolicySet() definition code for java.awt.Container.isFocusTraversalPolicySet() , layout sample code for java.awt.Container.layout() definition code for java.awt.Container.layout() , list sample code for java.awt.Container.list(java.io.PrintStream, int) definition code for java.awt.Container.list(java.io.PrintStream, int) , list sample code for java.awt.Container.list(java.io.PrintWriter, int) definition code for java.awt.Container.list(java.io.PrintWriter, int) , locate sample code for java.awt.Container.locate(int, int) definition code for java.awt.Container.locate(int, int) , minimumSize sample code for java.awt.Container.minimumSize() definition code for java.awt.Container.minimumSize() , paintComponents sample code for java.awt.Container.paintComponents(java.awt.Graphics) definition code for java.awt.Container.paintComponents(java.awt.Graphics) , preferredSize sample code for java.awt.Container.preferredSize() definition code for java.awt.Container.preferredSize() , printComponents sample code for java.awt.Container.printComponents(java.awt.Graphics) definition code for java.awt.Container.printComponents(java.awt.Graphics) , processContainerEvent sample code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) definition code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) , processEvent sample code for java.awt.Container.processEvent(java.awt.AWTEvent) definition code for java.awt.Container.processEvent(java.awt.AWTEvent) , remove sample code for java.awt.Container.remove(java.awt.Component) definition code for java.awt.Container.remove(java.awt.Component) , remove sample code for java.awt.Container.remove(int) definition code for java.awt.Container.remove(int) , removeAll sample code for java.awt.Container.removeAll() definition code for java.awt.Container.removeAll() , removeContainerListener sample code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) , setComponentZOrder sample code for java.awt.Container.setComponentZOrder(java.awt.Component, int) definition code for java.awt.Container.setComponentZOrder(java.awt.Component, int) , setFocusCycleRoot sample code for java.awt.Container.setFocusCycleRoot(boolean) definition code for java.awt.Container.setFocusCycleRoot(boolean) , setFocusTraversalPolicy sample code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) definition code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) , setFocusTraversalPolicyProvider sample code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) definition code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) , setLayout sample code for java.awt.Container.setLayout(java.awt.LayoutManager) definition code for java.awt.Container.setLayout(java.awt.LayoutManager) , transferFocusBackward sample code for java.awt.Container.transferFocusBackward() definition code for java.awt.Container.transferFocusBackward() , transferFocusDownCycle sample code for java.awt.Container.transferFocusDownCycle() definition code for java.awt.Container.transferFocusDownCycle() , validate sample code for java.awt.Container.validate() definition code for java.awt.Container.validate() , validateTree sample code for java.awt.Container.validateTree() definition code for java.awt.Container.validateTree()
 
Methods inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
action sample code for java.awt.Component.action(java.awt.Event, java.lang.Object) definition code for java.awt.Component.action(java.awt.Event, java.lang.Object) , add sample code for java.awt.Component.add(java.awt.PopupMenu) definition code for java.awt.Component.add(java.awt.PopupMenu) , addComponentListener sample code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) , addFocusListener sample code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) , addHierarchyBoundsListener sample code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , addHierarchyListener sample code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) , addInputMethodListener sample code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) , addKeyListener sample code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) , addMouseListener sample code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) , addMouseMotionListener sample code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) , addMouseWheelListener sample code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) , bounds sample code for java.awt.Component.bounds() definition code for java.awt.Component.bounds() , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , coalesceEvents sample code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) definition code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) , contains sample code for java.awt.Component.contains(java.awt.Point) definition code for java.awt.Component.contains(java.awt.Point) , createImage sample code for java.awt.Component.createImage(java.awt.image.ImageProducer) definition code for java.awt.Component.createImage(java.awt.image.ImageProducer) , createImage sample code for java.awt.Component.createImage(int, int) definition code for java.awt.Component.createImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int) definition code for java.awt.Component.createVolatileImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) definition code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) , disableEvents sample code for java.awt.Component.disableEvents(long) definition code for java.awt.Component.disableEvents(long) , dispatchEvent sample code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) definition code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) , enable sample code for java.awt.Component.enable(boolean) definition code for java.awt.Component.enable(boolean) , enableEvents sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long) , enableInputMethods sample code for java.awt.Component.enableInputMethods(boolean) definition code for java.awt.Component.enableInputMethods(boolean) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) definition code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, double, double) definition code for java.awt.Component.firePropertyChange(java.lang.String, double, double) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, float, float) definition code for java.awt.Component.firePropertyChange(java.lang.String, float, float) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, long, long) definition code for java.awt.Component.firePropertyChange(java.lang.String, long, long) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, short, short) definition code for java.awt.Component.firePropertyChange(java.lang.String, short, short) , getBackground sample code for java.awt.Component.getBackground() definition code for java.awt.Component.getBackground() , getBounds sample code for java.awt.Component.getBounds() definition code for java.awt.Component.getBounds() , getColorModel sample code for java.awt.Component.getColorModel() definition code for java.awt.Component.getColorModel() , getComponentListeners sample code for java.awt.Component.getComponentListeners() definition code for java.awt.Component.getComponentListeners() , getComponentOrientation sample code for java.awt.Component.getComponentOrientation() definition code for java.awt.Component.getComponentOrientation() , getCursor sample code for java.awt.Component.getCursor() definition code for java.awt.Component.getCursor() , getDropTarget sample code for java.awt.Component.getDropTarget() definition code for java.awt.Component.getDropTarget() , getFocusCycleRootAncestor sample code for java.awt.Component.getFocusCycleRootAncestor() definition code for java.awt.Component.getFocusCycleRootAncestor() , getFocusListeners sample code for java.awt.Component.getFocusListeners() definition code for java.awt.Component.getFocusListeners() , getFocusTraversalKeysEnabled sample code for java.awt.Component.getFocusTraversalKeysEnabled() definition code for java.awt.Component.getFocusTraversalKeysEnabled() , getFont sample code for java.awt.Component.getFont() definition code for java.awt.Component.getFont() , getForeground sample code for java.awt.Component.getForeground() definition code for java.awt.Component.getForeground() , getGraphicsConfiguration sample code for java.awt.Component.getGraphicsConfiguration() definition code for java.awt.Component.getGraphicsConfiguration() , getHierarchyBoundsListeners sample code for java.awt.Component.getHierarchyBoundsListeners() definition code for java.awt.Component.getHierarchyBoundsListeners() , getHierarchyListeners sample code for java.awt.Component.getHierarchyListeners() definition code for java.awt.Component.getHierarchyListeners() , getIgnoreRepaint sample code for java.awt.Component.getIgnoreRepaint() definition code for java.awt.Component.getIgnoreRepaint() , getInputContext sample code for java.awt.Component.getInputContext() definition code for java.awt.Component.getInputContext() , getInputMethodListeners sample code for java.awt.Component.getInputMethodListeners() definition code for java.awt.Component.getInputMethodListeners() , getInputMethodRequests sample code for java.awt.Component.getInputMethodRequests() definition code for java.awt.Component.getInputMethodRequests() , getKeyListeners sample code for java.awt.Component.getKeyListeners() definition code for java.awt.Component.getKeyListeners() , getLocale sample code for java.awt.Component.getLocale() definition code for java.awt.Component.getLocale() , getLocation sample code for java.awt.Component.getLocation() definition code for java.awt.Component.getLocation() , getLocationOnScreen sample code for java.awt.Component.getLocationOnScreen() definition code for java.awt.Component.getLocationOnScreen() , getMouseListeners sample code for java.awt.Component.getMouseListeners() definition code for java.awt.Component.getMouseListeners() , getMouseMotionListeners sample code for java.awt.Component.getMouseMotionListeners() definition code for java.awt.Component.getMouseMotionListeners() , getMousePosition sample code for java.awt.Component.getMousePosition() definition code for java.awt.Component.getMousePosition() , getMouseWheelListeners sample code for java.awt.Component.getMouseWheelListeners() definition code for java.awt.Component.getMouseWheelListeners() , getName sample code for java.awt.Component.getName() definition code for java.awt.Component.getName() , getParent sample code for java.awt.Component.getParent() definition code for java.awt.Component.getParent() , getPeer sample code for java.awt.Component.getPeer() definition code for java.awt.Component.getPeer() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners() definition code for java.awt.Component.getPropertyChangeListeners() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners(java.lang.String) definition code for java.awt.Component.getPropertyChangeListeners(java.lang.String) , getSize sample code for java.awt.Component.getSize() definition code for java.awt.Component.getSize() , getToolkit sample code for java.awt.Component.getToolkit() definition code for java.awt.Component.getToolkit() , getTreeLock sample code for java.awt.Component.getTreeLock() definition code for java.awt.Component.getTreeLock() , gotFocus sample code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) , handleEvent sample code for java.awt.Component.handleEvent(java.awt.Event) definition code for java.awt.Component.handleEvent(java.awt.Event) , hasFocus sample code for java.awt.Component.hasFocus() definition code for java.awt.Component.hasFocus() , hide sample code for java.awt.Component.hide() definition code for java.awt.Component.hide() , imageUpdate sample code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) definition code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) , inside sample code for java.awt.Component.inside(int, int) definition code for java.awt.Component.inside(int, int) , isBackgroundSet sample code for java.awt.Component.isBackgroundSet() definition code for java.awt.Component.isBackgroundSet() , isCursorSet sample code for java.awt.Component.isCursorSet() definition code for java.awt.Component.isCursorSet() , isDisplayable sample code for java.awt.Component.isDisplayable() definition code for java.awt.Component.isDisplayable() , isEnabled sample code for java.awt.Component.isEnabled() definition code for java.awt.Component.isEnabled() , isFocusable sample code for java.awt.Component.isFocusable() definition code for java.awt.Component.isFocusable() , isFocusOwner sample code for java.awt.Component.isFocusOwner() definition code for java.awt.Component.isFocusOwner() , isFocusTraversable sample code for java.awt.Component.isFocusTraversable() definition code for java.awt.Component.isFocusTraversable() , isFontSet sample code for java.awt.Component.isFontSet() definition code for java.awt.Component.isFontSet() , isForegroundSet sample code for java.awt.Component.isForegroundSet() definition code for java.awt.Component.isForegroundSet() , isLightweight sample code for java.awt.Component.isLightweight() definition code for java.awt.Component.isLightweight() , isMaximumSizeSet sample code for java.awt.Component.isMaximumSizeSet() definition code for java.awt.Component.isMaximumSizeSet() , isMinimumSizeSet sample code for java.awt.Component.isMinimumSizeSet() definition code for java.awt.Component.isMinimumSizeSet() , isPreferredSizeSet sample code for java.awt.Component.isPreferredSizeSet() definition code for java.awt.Component.isPreferredSizeSet() , isShowing sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing() , isValid sample code for java.awt.Component.isValid() definition code for java.awt.Component.isValid() , isVisible sample code for java.awt.Component.isVisible() definition code for java.awt.Component.isVisible() , keyDown sample code for java.awt.Component.keyDown(java.awt.Event, int) definition code for java.awt.Component.keyDown(java.awt.Event, int) , keyUp sample code for java.awt.Component.keyUp(java.awt.Event, int) definition code for java.awt.Component.keyUp(java.awt.Event, int) , list sample code for java.awt.Component.list() definition code for java.awt.Component.list() , list sample code for java.awt.Component.list(java.io.PrintStream) definition code for java.awt.Component.list(java.io.PrintStream) , list sample code for java.awt.Component.list(java.io.PrintWriter) definition code for java.awt.Component.list(java.io.PrintWriter) , location sample code for java.awt.Component.location() definition code for java.awt.Component.location() , lostFocus sample code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) , mouseDown sample code for java.awt.Component.mouseDown(java.awt.Event, int, int) definition code for java.awt.Component.mouseDown(java.awt.Event, int, int) , mouseDrag sample code for java.awt.Component.mouseDrag(java.awt.Event, int, int) definition code for java.awt.Component.mouseDrag(java.awt.Event, int, int) , mouseEnter sample code for java.awt.Component.mouseEnter(java.awt.Event, int, int) definition code for java.awt.Component.mouseEnter(java.awt.Event, int, int) , mouseExit sample code for java.awt.Component.mouseExit(java.awt.Event, int, int) definition code for java.awt.Component.mouseExit(java.awt.Event, int, int) , mouseMove sample code for java.awt.Component.mouseMove(java.awt.Event, int, int) definition code for java.awt.Component.mouseMove(java.awt.Event, int, int) , mouseUp sample code for java.awt.Component.mouseUp(java.awt.Event, int, int) definition code for java.awt.Component.mouseUp(java.awt.Event, int, int) , move sample code for java.awt.Component.move(int, int) definition code for java.awt.Component.move(int, int) , nextFocus sample code for java.awt.Component.nextFocus() definition code for java.awt.Component.nextFocus() , paintAll sample code for java.awt.Component.paintAll(java.awt.Graphics) definition code for java.awt.Component.paintAll(java.awt.Graphics) , postEvent sample code for java.awt.Component.postEvent(java.awt.Event) definition code for java.awt.Component.postEvent(java.awt.Event) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , processComponentEvent sample code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) definition code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) , processFocusEvent sample code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) definition code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) , processHierarchyBoundsEvent sample code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) , processHierarchyEvent sample code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) , processInputMethodEvent sample code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) , processMouseWheelEvent sample code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) definition code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) , remove sample code for java.awt.Component.remove(java.awt.MenuComponent) definition code for java.awt.Component.remove(java.awt.MenuComponent) , removeComponentListener sample code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) , removeFocusListener sample code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) , removeHierarchyBoundsListener sample code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , removeHierarchyListener sample code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) , removeInputMethodListener sample code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) , removeKeyListener sample code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) , removeMouseListener sample code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) , removeMouseMotionListener sample code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) , removeMouseWheelListener sample code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , repaint sample code for java.awt.Component.repaint() definition code for java.awt.Component.repaint() , repaint sample code for java.awt.Component.repaint(int, int, int, int) definition code for java.awt.Component.repaint(int, int, int, int) , repaint sample code for java.awt.Component.repaint(long) definition code for java.awt.Component.repaint(long) , resize sample code for java.awt.Component.resize(java.awt.Dimension) definition code for java.awt.Component.resize(java.awt.Dimension) , resize sample code for java.awt.Component.resize(int, int) definition code for java.awt.Component.resize(int, int) , setBounds sample code for java.awt.Component.setBounds(int, int, int, int) definition code for java.awt.Component.setBounds(int, int, int, int) , setBounds sample code for java.awt.Component.setBounds(java.awt.Rectangle) definition code for java.awt.Component.setBounds(java.awt.Rectangle) , setComponentOrientation sample code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) , setCursor sample code for java.awt.Component.setCursor(java.awt.Cursor) definition code for java.awt.Component.setCursor(java.awt.Cursor) , setDropTarget sample code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) definition code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) , setFocusable sample code for java.awt.Component.setFocusable(boolean) definition code for java.awt.Component.setFocusable(boolean) , setFocusTraversalKeysEnabled sample code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) definition code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) , setIgnoreRepaint sample code for java.awt.Component.setIgnoreRepaint(boolean) definition code for java.awt.Component.setIgnoreRepaint(boolean) , setLocale sample code for java.awt.Component.setLocale(java.util.Locale) definition code for java.awt.Component.setLocale(java.util.Locale) , setLocation sample code for java.awt.Component.setLocation(int, int) definition code for java.awt.Component.setLocation(int, int) , setLocation sample code for java.awt.Component.setLocation(java.awt.Point) definition code for java.awt.Component.setLocation(java.awt.Point) , setName sample code for java.awt.Component.setName(java.lang.String) definition code for java.awt.Component.setName(java.lang.String) , setSize sample code for java.awt.Component.setSize(java.awt.Dimension) definition code for java.awt.Component.setSize(java.awt.Dimension) , setSize sample code for java.awt.Component.setSize(int, int) definition code for java.awt.Component.setSize(int, int) , show sample code for java.awt.Component.show() definition code for java.awt.Component.show() , show sample code for java.awt.Component.show(boolean) definition code for java.awt.Component.show(boolean) , size sample code for java.awt.Component.size() definition code for java.awt.Component.size() , toString sample code for java.awt.Component.toString() definition code for java.awt.Component.toString() , transferFocus sample code for java.awt.Component.transferFocus() definition code for java.awt.Component.transferFocus() , transferFocusUpCycle sample code for java.awt.Component.transferFocusUpCycle() definition code for java.awt.Component.transferFocusUpCycle()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

AUTO_RESIZE_OFF sample code for javax.swing.JTable.AUTO_RESIZE_OFF

public static final int AUTO_RESIZE_OFF
Do not adjust column widths automatically; use a scrollbar.

See Also:
Constant Field Values

AUTO_RESIZE_NEXT_COLUMN sample code for javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN

public static final int AUTO_RESIZE_NEXT_COLUMN
When a column is adjusted in the UI, adjust the next column the opposite way.

See Also:
Constant Field Values

AUTO_RESIZE_SUBSEQUENT_COLUMNS sample code for javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS

public static final int AUTO_RESIZE_SUBSEQUENT_COLUMNS
During UI adjustment, change subsequent columns to preserve the total width; this is the default behavior.

See Also:
Constant Field Values

AUTO_RESIZE_LAST_COLUMN sample code for javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN

public static final int AUTO_RESIZE_LAST_COLUMN
During all resize operations, apply adjustments to the last column only.

See Also:
Constant Field Values

AUTO_RESIZE_ALL_COLUMNS sample code for javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS

public static final int AUTO_RESIZE_ALL_COLUMNS
During all resize operations, proportionately resize all columns.

See Also:
Constant Field Values

dataModel sample code for javax.swing.JTable.dataModel

protected TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel  dataModel
The TableModel of the table.


columnModel sample code for javax.swing.JTable.columnModel

protected TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel  columnModel
The TableColumnModel of the table.


selectionModel sample code for javax.swing.JTable.selectionModel

protected ListSelectionModel sample code for javax.swing.ListSelectionModel definition code for javax.swing.ListSelectionModel  selectionModel
The ListSelectionModel of the table, used to keep track of row selections.


tableHeader sample code for javax.swing.JTable.tableHeader

protected JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader  tableHeader
The TableHeader working with the table.


rowHeight sample code for javax.swing.JTable.rowHeight

protected int rowHeight
The height in pixels of each row in the table.


rowMargin sample code for javax.swing.JTable.rowMargin

protected int rowMargin
The height in pixels of the margin between the cells in each row.


gridColor sample code for javax.swing.JTable.gridColor

protected Color sample code for java.awt.Color definition code for java.awt.Color  gridColor
The color of the grid.


showHorizontalLines sample code for javax.swing.JTable.showHorizontalLines

protected boolean showHorizontalLines
The table draws horizontal lines between cells if showHorizontalLines is true.


showVerticalLines sample code for javax.swing.JTable.showVerticalLines

protected boolean showVerticalLines
The table draws vertical lines between cells if showVerticalLines is true.


autoResizeMode sample code for javax.swing.JTable.autoResizeMode

protected int 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.


autoCreateColumnsFromModel sample code for javax.swing.JTable.autoCreateColumnsFromModel

protected boolean autoCreateColumnsFromModel
The table will query the TableModel to build the default set of columns if this is true.


preferredViewportSize sample code for javax.swing.JTable.preferredViewportSize

protected Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  preferredViewportSize
Used by the Scrollable interface to determine the initial visible area.


rowSelectionAllowed sample code for javax.swing.JTable.rowSelectionAllowed

protected boolean rowSelectionAllowed
True if row selection is allowed in this table.


cellSelectionEnabled sample code for javax.swing.JTable.cellSelectionEnabled

protected boolean cellSelectionEnabled
Obsolete as of Java 2 platform v1.3. Please use the rowSelectionAllowed property and the columnSelectionAllowed property of the columnModel instead. Or use the method getCellSelectionEnabled.


editorComp sample code for javax.swing.JTable.editorComp

protected transient Component sample code for java.awt.Component definition code for java.awt.Component  editorComp
If editing, the Component that is handling the editing.


cellEditor sample code for javax.swing.JTable.cellEditor

protected transient TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  cellEditor
The object that overwrites the screen real estate occupied by the current cell and allows the user to change its contents.


editingColumn sample code for javax.swing.JTable.editingColumn

protected transient int editingColumn
Identifies the column of the cell being edited.


editingRow sample code for javax.swing.JTable.editingRow

protected transient int editingRow
Identifies the row of the cell being edited.


defaultRenderersByColumnClass sample code for javax.swing.JTable.defaultRenderersByColumnClass

protected transient Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable  defaultRenderersByColumnClass
A table of objects that display the contents of a cell, indexed by class as declared in getColumnClass in the TableModel interface.


defaultEditorsByColumnClass sample code for javax.swing.JTable.defaultEditorsByColumnClass

protected transient Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable  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.


selectionForeground sample code for javax.swing.JTable.selectionForeground

protected Color sample code for java.awt.Color definition code for java.awt.Color  selectionForeground
The foreground color of selected cells.


selectionBackground sample code for javax.swing.JTable.selectionBackground

protected Color sample code for java.awt.Color definition code for java.awt.Color  selectionBackground
The background color of selected cells.

Constructor Detail

JTable sample code for javax.swing.JTable() definition code for javax.swing.JTable()

public JTable()
Constructs a default JTable that is initialized with a default data model, a default column model, and a default selection model.

See Also:
createDefaultDataModel() sample code for javax.swing.JTable.createDefaultDataModel() definition code for javax.swing.JTable.createDefaultDataModel() , createDefaultColumnModel() sample code for javax.swing.JTable.createDefaultColumnModel() definition code for javax.swing.JTable.createDefaultColumnModel() , createDefaultSelectionModel() sample code for javax.swing.JTable.createDefaultSelectionModel() definition code for javax.swing.JTable.createDefaultSelectionModel()

JTable sample code for javax.swing.JTable(javax.swing.table.TableModel) definition code for javax.swing.JTable(javax.swing.table.TableModel)

public JTable(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.

Parameters:
dm - the data model for the table
See Also:
createDefaultColumnModel() sample code for javax.swing.JTable.createDefaultColumnModel() definition code for javax.swing.JTable.createDefaultColumnModel() , createDefaultSelectionModel() sample code for javax.swing.JTable.createDefaultSelectionModel() definition code for javax.swing.JTable.createDefaultSelectionModel()

JTable sample code for javax.swing.JTable(javax.swing.table.TableModel, javax.swing.table.TableColumnModel) definition code for javax.swing.JTable(javax.swing.table.TableModel, javax.swing.table.TableColumnModel)

public JTable(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.

Parameters:
dm - the data model for the table
cm - the column model for the table
See Also:
createDefaultSelectionModel() sample code for javax.swing.JTable.createDefaultSelectionModel() definition code for javax.swing.JTable.createDefaultSelectionModel()

JTable sample code for javax.swing.JTable(javax.swing.table.TableModel, javax.swing.table.TableColumnModel, javax.swing.ListSelectionModel) definition code for javax.swing.JTable(javax.swing.table.TableModel, javax.swing.table.TableColumnModel, javax.swing.ListSelectionModel)

public JTable(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. If any of the parameters are null this method will initialize the table with the corresponding default model. The autoCreateColumnsFromModel flag is set to false if cm is non-null, otherwise it is set to true and the column model is populated with suitable TableColumns for the columns in dm.

Parameters:
dm - the data model for the table
cm - the column model for the table
sm - the row selection model for the table
See Also:
createDefaultDataModel() sample code for javax.swing.JTable.createDefaultDataModel() definition code for javax.swing.JTable.createDefaultDataModel() , createDefaultColumnModel() sample code for javax.swing.JTable.createDefaultColumnModel() definition code for javax.swing.JTable.createDefaultColumnModel() , createDefaultSelectionModel() sample code for javax.swing.JTable.createDefaultSelectionModel() definition code for javax.swing.JTable.createDefaultSelectionModel()

JTable sample code for javax.swing.JTable(int, int) definition code for javax.swing.JTable(int, int)

public JTable(int numRows,
              int numColumns)
Constructs a JTable with numRows and numColumns of empty cells using DefaultTableModel. The columns will have names of the form "A", "B", "C", etc.

Parameters:
numRows - the number of rows the table holds
numColumns - the number of columns the table holds
See Also:
DefaultTableModel sample code for javax.swing.table.DefaultTableModel definition code for javax.swing.table.DefaultTableModel

JTable sample code for javax.swing.JTable(java.util.Vector, java.util.Vector) definition code for javax.swing.JTable(java.util.Vector, java.util.Vector)

public JTable(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. The Vectors contained in rowData should contain the values for that row. In other words, the value of the cell at row 1, column 5 can be obtained with the following code:

((Vector)rowData.elementAt(1)).elementAt(5);

Parameters:
rowData - the data for the new table
columnNames - names of each column

JTable sample code for javax.swing.JTable(java.lang.Object[][], java.lang.Object[]) definition code for javax.swing.JTable(java.lang.Object[][], java.lang.Object[])

public JTable(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. rowData is an array of rows, so the value of the cell at row 1, column 5 can be obtained with the following code:

 rowData[1][5]; 

All rows must be of the same length as columnNames.

Parameters:
rowData - the data for the new table
columnNames - names of each column
Method Detail

addNotify sample code for javax.swing.JTable.addNotify() definition code for javax.swing.JTable.addNotify()

public void addNotify()
Calls the configureEnclosingScrollPane method.

Overrides:
addNotify sample code for javax.swing.JComponent.addNotify() definition code for javax.swing.JComponent.addNotify() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
See Also:
configureEnclosingScrollPane() sample code for javax.swing.JTable.configureEnclosingScrollPane() definition code for javax.swing.JTable.configureEnclosingScrollPane()

configureEnclosingScrollPane sample code for javax.swing.JTable.configureEnclosingScrollPane() definition code for javax.swing.JTable.configureEnclosingScrollPane()

protected void 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. When a JTable is added to a JScrollPane in the usual way, using new JScrollPane(myTable), addNotify is called in the JTable (when the table is added to the viewport). JTable's addNotify method in turn calls this method, which is protected so that this default installation procedure can be overridden by a subclass.

See Also:
addNotify() sample code for javax.swing.JTable.addNotify() definition code for javax.swing.JTable.addNotify()

removeNotify sample code for javax.swing.JTable.removeNotify() definition code for javax.swing.JTable.removeNotify()

public void removeNotify()
Calls the unconfigureEnclosingScrollPane method.

Overrides:
removeNotify sample code for javax.swing.JComponent.removeNotify() definition code for javax.swing.JComponent.removeNotify() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
See Also:
unconfigureEnclosingScrollPane() sample code for javax.swing.JTable.unconfigureEnclosingScrollPane() definition code for javax.swing.JTable.unconfigureEnclosingScrollPane()

unconfigureEnclosingScrollPane sample code for javax.swing.JTable.unconfigureEnclosingScrollPane() definition code for javax.swing.JTable.unconfigureEnclosingScrollPane()

protected void unconfigureEnclosingScrollPane()
Reverses the effect of configureEnclosingScrollPane by replacing the columnHeaderView of the enclosing scroll pane with null. JTable's removeNotify method calls this method, which is protected so that this default uninstallation procedure can be overridden by a subclass.

See Also:
removeNotify() sample code for javax.swing.JTable.removeNotify() definition code for javax.swing.JTable.removeNotify() , configureEnclosingScrollPane() sample code for javax.swing.JTable.configureEnclosingScrollPane() definition code for javax.swing.JTable.configureEnclosingScrollPane()

createScrollPaneForTable sample code for javax.swing.JTable.createScrollPaneForTable(javax.swing.JTable) definition code for javax.swing.JTable.createScrollPaneForTable(javax.swing.JTable)

@Deprecated
public static JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane  createScrollPaneForTable(JTable sample code for javax.swing.JTable definition code for javax.swing.JTable  aTable)
Deprecated. As of Swing version 1.0.2, replaced by new JScrollPane(aTable).

Equivalent to new JScrollPane(aTable).


setTableHeader sample code for javax.swing.JTable.setTableHeader(javax.swing.table.JTableHeader) definition code for javax.swing.JTable.setTableHeader(javax.swing.table.JTableHeader)

public void setTableHeader(JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader  tableHeader)
Sets the tableHeader working with this JTable to newHeader. It is legal to have a null tableHeader.

Parameters:
tableHeader - new tableHeader
See Also:
getTableHeader() sample code for javax.swing.JTable.getTableHeader() definition code for javax.swing.JTable.getTableHeader()

getTableHeader sample code for javax.swing.JTable.getTableHeader() definition code for javax.swing.JTable.getTableHeader()

public JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader  getTableHeader()
Returns the tableHeader used by this JTable.

Returns:
the tableHeader used by this table
See Also:
setTableHeader(javax.swing.table.JTableHeader) sample code for javax.swing.JTable.setTableHeader(javax.swing.table.JTableHeader) definition code for javax.swing.JTable.setTableHeader(javax.swing.table.JTableHeader)

setRowHeight sample code for javax.swing.JTable.setRowHeight(int) definition code for javax.swing.JTable.setRowHeight(int)

public void setRowHeight(int rowHeight)
Sets the height, in pixels, of all cells to rowHeight, revalidates, and repaints. The height of the cells will be equal to the row height minus the row margin.

Parameters:
rowHeight - new row height
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if rowHeight is less than 1
See Also:
getRowHeight() sample code for javax.swing.JTable.getRowHeight() definition code for javax.swing.JTable.getRowHeight()

getRowHeight sample code for javax.swing.JTable.getRowHeight() definition code for javax.swing.JTable.getRowHeight()

public int getRowHeight()
Returns the height of a table row, in pixels. The default row height is 16.0.

Returns:
the height in pixels of a table row
See Also:
setRowHeight(int) sample code for javax.swing.JTable.setRowHeight(int) definition code for javax.swing.JTable.setRowHeight(int)

setRowHeight sample code for javax.swing.JTable.setRowHeight(int, int) definition code for javax.swing.JTable.setRowHeight(int, int)

public void setRowHeight(int row,
                         int rowHeight)
Sets the height for row to rowHeight, revalidates, and repaints. The height of the cells in this row will be equal to the row height minus the row margin.

Parameters:
row - the row whose height is being changed
rowHeight - new row height, in pixels
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if rowHeight is less than 1

getRowHeight sample code for javax.swing.JTable.getRowHeight(int) definition code for javax.swing.JTable.getRowHeight(int)

public int getRowHeight(int row)
Returns the height, in pixels, of the cells in row.

Parameters:
row - the row whose height is to be returned
Returns:
the height, in pixels, of the cells in the row

setRowMargin sample code for javax.swing.JTable.setRowMargin(int) definition code for javax.swing.JTable.setRowMargin(int)

public void setRowMargin(int rowMargin)
Sets the amount of empty space between cells in adjacent rows.

Parameters:
rowMargin - the number of pixels between cells in a row
See Also:
getRowMargin() sample code for javax.swing.JTable.getRowMargin() definition code for javax.swing.JTable.getRowMargin()

getRowMargin sample code for javax.swing.JTable.getRowMargin() definition code for javax.swing.JTable.getRowMargin()

public int getRowMargin()
Gets the amount of empty space, in pixels, between cells. Equivalent to: getIntercellSpacing().height.

Returns:
the number of pixels between cells in a row
See Also:
setRowMargin(int) sample code for javax.swing.JTable.setRowMargin(int) definition code for javax.swing.JTable.setRowMargin(int)

setIntercellSpacing sample code for javax.swing.JTable.setIntercellSpacing(java.awt.Dimension) definition code for javax.swing.JTable.setIntercellSpacing(java.awt.Dimension)

public void setIntercellSpacing(Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  intercellSpacing)
Sets the rowMargin and the columnMargin -- the height and width of the space between cells -- to intercellSpacing.

Parameters:
intercellSpacing - a Dimension specifying the new width and height between cells
See Also:
getIntercellSpacing() sample code for javax.swing.JTable.getIntercellSpacing() definition code for javax.swing.JTable.getIntercellSpacing()

getIntercellSpacing sample code for javax.swing.JTable.getIntercellSpacing() definition code for javax.swing.JTable.getIntercellSpacing()

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getIntercellSpacing()
Returns the horizontal and vertical space between cells. The default spacing is (1, 1), which provides room to draw the grid.

Returns:
the horizontal and vertical spacing between cells
See Also:
setIntercellSpacing(java.awt.Dimension) sample code for javax.swing.JTable.setIntercellSpacing(java.awt.Dimension) definition code for javax.swing.JTable.setIntercellSpacing(java.awt.Dimension)

setGridColor sample code for javax.swing.JTable.setGridColor(java.awt.Color) definition code for javax.swing.JTable.setGridColor(java.awt.Color)

public void setGridColor(Color sample code for java.awt.Color definition code for java.awt.Color  gridColor)
Sets the color used to draw grid lines to gridColor and redisplays. The default color is look and feel dependent.

Parameters:
gridColor - the new color of the grid lines
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if gridColor is null
See Also:
getGridColor() sample code for javax.swing.JTable.getGridColor() definition code for javax.swing.JTable.getGridColor()

getGridColor sample code for javax.swing.JTable.getGridColor() definition code for javax.swing.JTable.getGridColor()

public Color sample code for java.awt.Color definition code for java.awt.Color  getGridColor()
Returns the color used to draw grid lines. The default color is look and feel dependent.

Returns:
the color used to draw grid lines
See Also:
setGridColor(java.awt.Color) sample code for javax.swing.JTable.setGridColor(java.awt.Color) definition code for javax.swing.JTable.setGridColor(java.awt.Color)

setShowGrid sample code for javax.swing.JTable.setShowGrid(boolean) definition code for javax.swing.JTable.setShowGrid(boolean)

public void setShowGrid(boolean showGrid)
Sets whether the table draws grid lines around cells. If showGrid is true it does; if it is false it doesn't. There is no getShowGrid method as this state is held in two variables -- showHorizontalLines and showVerticalLines -- each of which can be queried independently.

Parameters:
showGrid - true if table view should draw grid lines
See Also:
setShowVerticalLines(boolean) sample code for javax.swing.JTable.setShowVerticalLines(boolean) definition code for javax.swing.JTable.setShowVerticalLines(boolean) , setShowHorizontalLines(boolean) sample code for javax.swing.JTable.setShowHorizontalLines(boolean) definition code for javax.swing.JTable.setShowHorizontalLines(boolean)

setShowHorizontalLines sample code for javax.swing.JTable.setShowHorizontalLines(boolean) definition code for javax.swing.JTable.setShowHorizontalLines(boolean)

public void setShowHorizontalLines(boolean showHorizontalLines)
Sets whether the table draws horizontal lines between cells. If showHorizontalLines is true it does; if it is false it doesn't.

Parameters:
showHorizontalLines - true if table view should draw horizontal lines
See Also:
getShowHorizontalLines() sample code for javax.swing.JTable.getShowHorizontalLines() definition code for javax.swing.JTable.getShowHorizontalLines() , setShowGrid(boolean) sample code for javax.swing.JTable.setShowGrid(boolean) definition code for javax.swing.JTable.setShowGrid(boolean) , setShowVerticalLines(boolean) sample code for javax.swing.JTable.setShowVerticalLines(boolean) definition code for javax.swing.JTable.setShowVerticalLines(boolean)

setShowVerticalLines sample code for javax.swing.JTable.setShowVerticalLines(boolean) definition code for javax.swing.JTable.setShowVerticalLines(boolean)

public void setShowVerticalLines(boolean showVerticalLines)
Sets whether the table draws vertical lines between cells. If showVerticalLines is true it does; if it is false it doesn't.

Parameters:
showVerticalLines - true if table view should draw vertical lines
See Also:
getShowVerticalLines() sample code for javax.swing.JTable.getShowVerticalLines() definition code for javax.swing.JTable.getShowVerticalLines() , setShowGrid(boolean) sample code for javax.swing.JTable.setShowGrid(boolean) definition code for javax.swing.JTable.setShowGrid(boolean) , setShowHorizontalLines(boolean) sample code for javax.swing.JTable.setShowHorizontalLines(boolean) definition code for javax.swing.JTable.setShowHorizontalLines(boolean)

getShowHorizontalLines sample code for javax.swing.JTable.getShowHorizontalLines() definition code for javax.swing.JTable.getShowHorizontalLines()

public boolean getShowHorizontalLines()
Returns true if the table draws horizontal lines between cells, false if it doesn't. The default is true.

Returns:
true if the table draws horizontal lines between cells, false if it doesn't
See Also:
setShowHorizontalLines(boolean) sample code for javax.swing.JTable.setShowHorizontalLines(boolean) definition code for javax.swing.JTable.setShowHorizontalLines(boolean)

getShowVerticalLines sample code for javax.swing.JTable.getShowVerticalLines() definition code for javax.swing.JTable.getShowVerticalLines()

public boolean getShowVerticalLines()
Returns true if the table draws vertical lines between cells, false if it doesn't. The default is true.

Returns:
true if the table draws vertical lines between cells, false if it doesn't
See Also:
setShowVerticalLines(boolean) sample code for javax.swing.JTable.setShowVerticalLines(boolean) definition code for javax.swing.JTable.setShowVerticalLines(boolean)

setAutoResizeMode sample code for javax.swing.JTable.setAutoResizeMode(int) definition code for javax.swing.JTable.setAutoResizeMode(int)

public void setAutoResizeMode(int mode)
Sets the table's auto resize mode when the table is resized.

Parameters:
mode - One of 5 legal values: AUTO_RESIZE_OFF, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_SUBSEQUENT_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_ALL_COLUMNS
See Also:
getAutoResizeMode() sample code for javax.swing.JTable.getAutoResizeMode() definition code for javax.swing.JTable.getAutoResizeMode() , doLayout() sample code for javax.swing.JTable.doLayout() definition code for javax.swing.JTable.doLayout()

getAutoResizeMode sample code for javax.swing.JTable.getAutoResizeMode() definition code for javax.swing.JTable.getAutoResizeMode()

public int getAutoResizeMode()
Returns the auto resize mode of the table. The default mode is AUTO_RESIZE_SUBSEQUENT_COLUMNS.

Returns:
the autoResizeMode of the table
See Also:
setAutoResizeMode(int) sample code for javax.swing.JTable.setAutoResizeMode(int) definition code for javax.swing.JTable.setAutoResizeMode(int) , doLayout() sample code for javax.swing.JTable.doLayout() definition code for javax.swing.JTable.doLayout()

setAutoCreateColumnsFromModel sample code for javax.swing.JTable.setAutoCreateColumnsFromModel(boolean) definition code for javax.swing.JTable.setAutoCreateColumnsFromModel(boolean)

public void setAutoCreateColumnsFromModel(boolean autoCreateColumnsFromModel)
Sets this table's autoCreateColumnsFromModel flag. This method calls createDefaultColumnsFromModel if autoCreateColumnsFromModel changes from false to true.

Parameters:
autoCreateColumnsFromModel - true if JTable should automatically create columns
See Also:
getAutoCreateColumnsFromModel() sample code for javax.swing.JTable.getAutoCreateColumnsFromModel() definition code for javax.swing.JTable.getAutoCreateColumnsFromModel() , createDefaultColumnsFromModel() sample code for javax.swing.JTable.createDefaultColumnsFromModel() definition code for javax.swing.JTable.createDefaultColumnsFromModel()

getAutoCreateColumnsFromModel sample code for javax.swing.JTable.getAutoCreateColumnsFromModel() definition code for javax.swing.JTable.getAutoCreateColumnsFromModel()

public boolean getAutoCreateColumnsFromModel()
Determines whether the table will create default columns from the model. If true, setModel will clear any existing columns and create new columns from the new model. Also, if the event in the tableChanged notification specifies that the entire table changed, then the columns will be rebuilt. The default is true.

Returns:
the autoCreateColumnsFromModel of the table
See Also:
setAutoCreateColumnsFromModel(boolean) sample code for javax.swing.JTable.setAutoCreateColumnsFromModel(boolean) definition code for javax.swing.JTable.setAutoCreateColumnsFromModel(boolean) , createDefaultColumnsFromModel() sample code for javax.swing.JTable.createDefaultColumnsFromModel() definition code for javax.swing.JTable.createDefaultColumnsFromModel()

createDefaultColumnsFromModel sample code for javax.swing.JTable.createDefaultColumnsFromModel() definition code for javax.swing.JTable.createDefaultColumnsFromModel()

public void createDefaultColumnsFromModel()
Creates default columns for the table from the data model using the getColumnCount method defined in the TableModel interface.

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

See Also:
getAutoCreateColumnsFromModel() sample code for javax.swing.JTable.getAutoCreateColumnsFromModel() definition code for javax.swing.JTable.getAutoCreateColumnsFromModel()

setDefaultRenderer sample code for javax.swing.JTable.setDefaultRenderer(java.lang.Class<?>, javax.swing.table.TableCellRenderer) definition code for javax.swing.JTable.setDefaultRenderer(java.lang.Class<?>, javax.swing.table.TableCellRenderer)

public void setDefaultRenderer(Class sample code for java.lang.Class definition code for java.lang.Class <?> columnClass,
                               TableCellRenderer sample code for javax.swing.table.TableCellRenderer definition code for javax.swing.table.TableCellRenderer  renderer)
Sets a default cell renderer to be used if no renderer has been set in a TableColumn. If renderer is null, removes the default renderer for this column class.

Parameters:
columnClass - set the default cell renderer for this columnClass
renderer - default cell renderer to be used for this columnClass
See Also:
getDefaultRenderer(java.lang.Class) sample code for javax.swing.JTable.getDefaultRenderer(java.lang.Class) definition code for javax.swing.JTable.getDefaultRenderer(java.lang.Class) , setDefaultEditor(java.lang.Class, javax.swing.table.TableCellEditor) sample code for javax.swing.JTable.setDefaultEditor(java.lang.Class, javax.swing.table.TableCellEditor) definition code for javax.swing.JTable.setDefaultEditor(java.lang.Class, javax.swing.table.TableCellEditor)

getDefaultRenderer sample code for javax.swing.JTable.getDefaultRenderer(java.lang.Class<?>) definition code for javax.swing.JTable.getDefaultRenderer(java.lang.Class<?>)

public TableCellRenderer sample code for javax.swing.table.TableCellRenderer definition code for javax.swing.table.TableCellRenderer  getDefaultRenderer(Class sample code for java.lang.Class definition code for java.lang.Class <?> columnClass)
Returns the cell renderer to be used when no renderer has been set in a TableColumn. During the rendering of cells the renderer is fetched from a Hashtable of entries according to the class of the cells in the column. If there is no entry for this columnClass the method returns the entry for the most specific superclass. The JTable installs entries for Object, Number, and Boolean, all of which can be modified or replaced.

Parameters:
columnClass - return the default cell renderer for this columnClass
Returns:
the renderer for this columnClass
See Also:
setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer) sample code for javax.swing.JTable.setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer) definition code for javax.swing.JTable.setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer) , getColumnClass(int) sample code for javax.swing.JTable.getColumnClass(int) definition code for javax.swing.JTable.getColumnClass(int)

setDefaultEditor sample code for javax.swing.JTable.setDefaultEditor(java.lang.Class<?>, javax.swing.table.TableCellEditor) definition code for javax.swing.JTable.setDefaultEditor(java.lang.Class<?>, javax.swing.table.TableCellEditor)

public void setDefaultEditor(Class sample code for java.lang.Class definition code for java.lang.Class <?> columnClass,
                             TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  editor)
Sets a default cell editor to be used if no editor has been set in a TableColumn. If no editing is required in a table, or a particular column in a table, uses the isCellEditable method in the TableModel interface to ensure that this JTable will not start an editor in these columns. If editor is null, removes the default editor for this column class.

Parameters:
columnClass - set the default cell editor for this columnClass
editor - default cell editor to be used for this columnClass
See Also:
TableModel.isCellEditable(int, int) sample code for javax.swing.table.TableModel.isCellEditable(int, int) definition code for javax.swing.table.TableModel.isCellEditable(int, int) , getDefaultEditor(java.lang.Class) sample code for javax.swing.JTable.getDefaultEditor(java.lang.Class) definition code for javax.swing.JTable.getDefaultEditor(java.lang.Class) , setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer) sample code for javax.swing.JTable.setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer) definition code for javax.swing.JTable.setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer)

getDefaultEditor sample code for javax.swing.JTable.getDefaultEditor(java.lang.Class<?>) definition code for javax.swing.JTable.getDefaultEditor(java.lang.Class<?>)

public TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  getDefaultEditor(Class sample code for java.lang.Class definition code for java.lang.Class <?> columnClass)
Returns the editor to be used when no editor has been set in a TableColumn. During the editing of cells the editor is fetched from a Hashtable of entries according to the class of the cells in the column. If there is no entry for this columnClass the method returns the entry for the most specific superclass. The JTable installs entries for Object, Number, and Boolean, all of which can be modified or replaced.

Parameters:
columnClass - return the default cell editor for this columnClass
Returns:
the default cell editor to be used for this columnClass
See Also:
setDefaultEditor(java.lang.Class, javax.swing.table.TableCellEditor) sample code for javax.swing.JTable.setDefaultEditor(java.lang.Class, javax.swing.table.TableCellEditor) definition code for javax.swing.JTable.setDefaultEditor(java.lang.Class, javax.swing.table.TableCellEditor) , getColumnClass(int) sample code for javax.swing.JTable.getColumnClass(int) definition code for javax.swing.JTable.getColumnClass(int)

setDragEnabled sample code for javax.swing.JTable.setDragEnabled(boolean) definition code for javax.swing.JTable.setDragEnabled(boolean)

public void setDragEnabled(boolean b)
Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component. The transferHandler property needs to be set to a non-null value for the drag to do anything. The default value of the dragEnabledfalse.

When automatic drag handling is enabled, most look and feels begin a drag-and-drop operation whenever the user presses the mouse button over a selection and then moves the mouse a few pixels. Setting this property to true can therefore have a subtle effect on how selections behave.

Some look and feels might not support automatic drag and drop; they will ignore this property. You can work around such look and feels by modifying the component to directly call the exportAsDrag method of a TransferHandler.

Parameters:
b - the value to set the dragEnabled property to
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if b is true and GraphicsEnvironment.isHeadless() returns true
Since:
1.4
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless() , getDragEnabled() sample code for javax.swing.JTable.getDragEnabled() definition code for javax.swing.JTable.getDragEnabled() , JComponent.setTransferHandler(javax.swing.TransferHandler) sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) , TransferHandler sample code for javax.swing.TransferHandler definition code for javax.swing.TransferHandler

getDragEnabled sample code for javax.swing.JTable.getDragEnabled() definition code for javax.swing.JTable.getDragEnabled()

public boolean getDragEnabled()
Gets the value of the dragEnabled property.

Returns:
the value of the dragEnabled property
Since:
1.4
See Also:
setDragEnabled(boolean) sample code for javax.swing.JTable.setDragEnabled(boolean) definition code for javax.swing.JTable.setDragEnabled(boolean)

setSelectionMode sample code for javax.swing.JTable.setSelectionMode(int) definition code for javax.swing.JTable.setSelectionMode(int)

public void setSelectionMode(int selectionMode)
Sets the table's selection mode to allow only single selections, a single contiguous interval, or multiple intervals.

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

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

See Also:
JList.setSelectionMode(int) sample code for javax.swing.JList.setSelectionMode(int) definition code for javax.swing.JList.setSelectionMode(int)

setRowSelectionAllowed sample code for javax.swing.JTable.setRowSelectionAllowed(boolean) definition code for javax.swing.JTable.setRowSelectionAllowed(boolean)

public void setRowSelectionAllowed(boolean rowSelectionAllowed)
Sets whether the rows in this model can be selected.

Parameters:
rowSelectionAllowed - true if this model will allow row selection
See Also:
getRowSelectionAllowed() sample code for javax.swing.JTable.getRowSelectionAllowed() definition code for javax.swing.JTable.getRowSelectionAllowed()

getRowSelectionAllowed sample code for javax.swing.JTable.getRowSelectionAllowed() definition code for javax.swing.JTable.getRowSelectionAllowed()

public boolean getRowSelectionAllowed()
Returns true if rows can be selected.

Returns:
true if rows can be selected, otherwise false
See Also:
setRowSelectionAllowed(boolean) sample code for javax.swing.JTable.setRowSelectionAllowed(boolean) definition code for javax.swing.JTable.setRowSelectionAllowed(boolean)

setColumnSelectionAllowed sample code for javax.swing.JTable.setColumnSelectionAllowed(boolean) definition code for javax.swing.JTable.setColumnSelectionAllowed(boolean)

public void setColumnSelectionAllowed(boolean columnSelectionAllowed)
Sets whether the columns in this model can be selected.

Parameters:
columnSelectionAllowed - true if this model will allow column selection
See Also:
getColumnSelectionAllowed() sample code for javax.swing.JTable.getColumnSelectionAllowed() definition code for javax.swing.JTable.getColumnSelectionAllowed()

getColumnSelectionAllowed sample code for javax.swing.JTable.getColumnSelectionAllowed() definition code for javax.swing.JTable.getColumnSelectionAllowed()

public boolean getColumnSelectionAllowed()
Returns true if columns can be selected.

Returns:
true if columns can be selected, otherwise false
See Also:
setColumnSelectionAllowed(boolean) sample code for javax.swing.JTable.setColumnSelectionAllowed(boolean) definition code for javax.swing.JTable.setColumnSelectionAllowed(boolean)

setCellSelectionEnabled sample code for javax.swing.JTable.setCellSelectionEnabled(boolean) definition code for javax.swing.JTable.setCellSelectionEnabled(boolean)

public void setCellSelectionEnabled(boolean cellSelectionEnabled)
Sets whether this table allows both a column selection and a row selection to exist simultaneously. When set, the table treats the intersection of the row and column selection models as the selected cells. Override isCellSelected to change this default behavior. This method is equivalent to setting both the rowSelectionAllowed property and columnSelectionAllowed property of the columnModel to the supplied value.

Parameters:
cellSelectionEnabled - true if simultaneous row and column selection is allowed
See Also:
getCellSelectionEnabled() sample code for javax.swing.JTable.getCellSelectionEnabled() definition code for javax.swing.JTable.getCellSelectionEnabled() , isCellSelected(int, int) sample code for javax.swing.JTable.isCellSelected(int, int) definition code for javax.swing.JTable.isCellSelected(int, int)

getCellSelectionEnabled sample code for javax.swing.JTable.getCellSelectionEnabled() definition code for javax.swing.JTable.getCellSelectionEnabled()

public boolean getCellSelectionEnabled()
Returns true if both row and column selection models are enabled. Equivalent to getRowSelectionAllowed() && getColumnSelectionAllowed().

Returns:
true if both row and column selection models are enabled
See Also:
setCellSelectionEnabled(boolean) sample code for javax.swing.JTable.setCellSelectionEnabled(boolean) definition code for javax.swing.JTable.setCellSelectionEnabled(boolean)

selectAll sample code for javax.swing.JTable.selectAll() definition code for javax.swing.JTable.selectAll()

public void selectAll()
Selects all rows, columns, and cells in the table.


clearSelection sample code for javax.swing.JTable.clearSelection() definition code for javax.swing.JTable.clearSelection()

public void clearSelection()
Deselects all selected columns and rows.


setRowSelectionInterval sample code for javax.swing.JTable.setRowSelectionInterval(int, int) definition code for javax.swing.JTable.setRowSelectionInterval(int, int)

public void setRowSelectionInterval(int index0,
                                    int index1)
Selects the rows from index0 to index1, inclusive.

Parameters:
index0 - one end of the interval
index1 - the other end of the interval
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if index0 or index1 lie outside [0, getRowCount()-1]

setColumnSelectionInterval sample code for javax.swing.JTable.setColumnSelectionInterval(int, int) definition code for javax.swing.JTable.setColumnSelectionInterval(int, int)

public void setColumnSelectionInterval(int index0,
                                       int index1)
Selects the columns from index0 to index1, inclusive.

Parameters:
index0 - one end of the interval
index1 - the other end of the interval
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if index0 or index1 lie outside [0, getColumnCount()-1]

addRowSelectionInterval sample code for javax.swing.JTable.addRowSelectionInterval(int, int) definition code for javax.swing.JTable.addRowSelectionInterval(int, int)

public void addRowSelectionInterval(int index0,
                                    int index1)
Adds the rows from index0 to index1, inclusive, to the current selection.

Parameters:
index0 - one end of the interval
index1 - the other end of the interval
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if index0 or index1 lie outside [0, getRowCount()-1]

addColumnSelectionInterval sample code for javax.swing.JTable.addColumnSelectionInterval(int, int) definition code for javax.swing.JTable.addColumnSelectionInterval(int, int)

public void addColumnSelectionInterval(int index0,
                                       int index1)
Adds the columns from index0 to index1, inclusive, to the current selection.

Parameters:
index0 - one end of the interval
index1 - the other end of the interval
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if index0 or index1 lie outside [0, getColumnCount()-1]

removeRowSelectionInterval sample code for javax.swing.JTable.removeRowSelectionInterval(int, int) definition code for javax.swing.JTable.removeRowSelectionInterval(int, int)

public void removeRowSelectionInterval(int index0,
                                       int index1)
Deselects the rows from index0 to index1, inclusive.

Parameters:
index0 - one end of the interval
index1 - the other end of the interval
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if index0 or index1 lie outside [0, getRowCount()-1]

removeColumnSelectionInterval sample code for javax.swing.JTable.removeColumnSelectionInterval(int, int) definition code for javax.swing.JTable.removeColumnSelectionInterval(int, int)

public void removeColumnSelectionInterval(int index0,
                                          int index1)
Deselects the columns from index0 to index1, inclusive.

Parameters:
index0 - one end of the interval
index1 - the other end of the interval
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if index0 or index1 lie outside [0, getColumnCount()-1]

getSelectedRow sample code for javax.swing.JTable.getSelectedRow() definition code for javax.swing.JTable.getSelectedRow()

public int getSelectedRow()
Returns the index of the first selected row, -1 if no row is selected.

Returns:
the index of the first selected row

getSelectedColumn sample code for javax.swing.JTable.getSelectedColumn() definition code for javax.swing.JTable.getSelectedColumn()

public int getSelectedColumn()
Returns the index of the first selected column, -1 if no column is selected.

Returns:
the index of the first selected column

getSelectedRows sample code for javax.swing.JTable.getSelectedRows() definition code for javax.swing.JTable.getSelectedRows()

public int[] getSelectedRows()
Returns the indices of all selected rows.

Returns:
an array of integers containing the indices of all selected rows, or an empty array if no row is selected
See Also:
getSelectedRow() sample code for javax.swing.JTable.getSelectedRow() definition code for javax.swing.JTable.getSelectedRow()

getSelectedColumns sample code for javax.swing.JTable.getSelectedColumns() definition code for javax.swing.JTable.getSelectedColumns()

public int[] getSelectedColumns()
Returns the indices of all selected columns.

Returns:
an array of integers containing the indices of all selected columns, or an empty array if no column is selected
See Also:
getSelectedColumn() sample code for javax.swing.JTable.getSelectedColumn() definition code for javax.swing.JTable.getSelectedColumn()

getSelectedRowCount sample code for javax.swing.JTable.getSelectedRowCount() definition code for javax.swing.JTable.getSelectedRowCount()

public int getSelectedRowCount()
Returns the number of selected rows.

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

getSelectedColumnCount sample code for javax.swing.JTable.getSelectedColumnCount() definition code for javax.swing.JTable.getSelectedColumnCount()

public int getSelectedColumnCount()
Returns the number of selected columns.

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

isRowSelected sample code for javax.swing.JTable.isRowSelected(int) definition code for javax.swing.JTable.isRowSelected(int)

public boolean isRowSelected(int row)
Returns true if the specified index is in the valid range of rows, and the row at that index is selected.

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

isColumnSelected sample code for javax.swing.JTable.isColumnSelected(int) definition code for javax.swing.JTable.isColumnSelected(int)

public boolean isColumnSelected(int column)
Returns true if the specified index is in the valid range of columns, and the column at that index is selected.

Parameters:
column - the column in the column model
Returns:
true if column is a valid index and the column at that index is selected (where 0 is the first column)

isCellSelected sample code for javax.swing.JTable.isCellSelected(int, int) definition code for javax.swing.JTable.isCellSelected(int, int)

public boolean isCellSelected(int row,
                              int column)
Returns true if the specified indices are in the valid range of rows and columns and the cell at the specified position is selected.

Parameters:
row - the row being queried
column - the column being queried
Returns:
true if row and column are valid indices and the cell at index (row, column) is selected, where the first row and first column are at index 0

changeSelection sample code for javax.swing.JTable.changeSelection(int, int, boolean, boolean) definition code for javax.swing.JTable.changeSelection(int, int, boolean, boolean)

public void changeSelection(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. Most changes to the selection that are the result of keyboard or mouse events received by the UI are channeled through this method so that the behavior may be overridden by a subclass. Some UIs may need more functionality than this method provides, such as when manipulating the lead for discontiguous selection, and may not call into this method for some selection changes.

This implementation uses the following conventions:

Parameters:
rowIndex - affects the selection at row
columnIndex - affects the selection at column
toggle - see description above
extend - if true, extend the current selection

getSelectionForeground sample code for javax.swing.JTable.getSelectionForeground() definition code for javax.swing.JTable.getSelectionForeground()

public Color sample code for java.awt.Color definition code for java.awt.Color  getSelectionForeground()
Returns the foreground color for selected cells.

Returns:
the Color object for the foreground property
See Also:
setSelectionForeground(java.awt.Color) sample code for javax.swing.JTable.setSelectionForeground(java.awt.Color) definition code for javax.swing.JTable.setSelectionForeground(java.awt.Color) , setSelectionBackground(java.awt.Color) sample code for javax.swing.JTable.setSelectionBackground(java.awt.Color) definition code for javax.swing.JTable.setSelectionBackground(java.awt.Color)

setSelectionForeground sample code for javax.swing.JTable.setSelectionForeground(java.awt.Color) definition code for javax.swing.JTable.setSelectionForeground(java.awt.Color)

public void setSelectionForeground(Color sample code for java.awt.Color definition code for java.awt.Color  selectionForeground)
Sets the foreground color for selected cells. Cell renderers can use this color to render text and graphics for selected cells.

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

This is a JavaBeans bound property.

Parameters:
selectionForeground - the Color to use in the foreground for selected list items
See Also:
getSelectionForeground() sample code for javax.swing.JTable.getSelectionForeground() definition code for javax.swing.JTable.getSelectionForeground() , setSelectionBackground(java.awt.Color) sample code for javax.swing.JTable.setSelectionBackground(java.awt.Color) definition code for javax.swing.JTable.setSelectionBackground(java.awt.Color) , JComponent.setForeground(java.awt.Color) sample code for javax.swing.JComponent.setForeground(java.awt.Color) definition code for javax.swing.JComponent.setForeground(java.awt.Color) , JComponent.setBackground(java.awt.Color) sample code for javax.swing.JComponent.setBackground(java.awt.Color) definition code for javax.swing.JComponent.setBackground(java.awt.Color) , JComponent.setFont(java.awt.Font) sample code for javax.swing.JComponent.setFont(java.awt.Font) definition code for javax.swing.JComponent.setFont(java.awt.Font)

getSelectionBackground sample code for javax.swing.JTable.getSelectionBackground() definition code for javax.swing.JTable.getSelectionBackground()

public Color sample code for java.awt.Color definition code for java.awt.Color  getSelectionBackground()
Returns the background color for selected cells.

Returns:
the Color used for the background of selected list items
See Also:
setSelectionBackground(java.awt.Color) sample code for javax.swing.JTable.setSelectionBackground(java.awt.Color) definition code for javax.swing.JTable.setSelectionBackground(java.awt.Color) , setSelectionForeground(java.awt.Color) sample code for javax.swing.JTable.setSelectionForeground(java.awt.Color) definition code for javax.swing.JTable.setSelectionForeground(java.awt.Color)

setSelectionBackground sample code for javax.swing.JTable.setSelectionBackground(java.awt.Color) definition code for javax.swing.JTable.setSelectionBackground(java.awt.Color)

public void setSelectionBackground(Color sample code for java.awt.Color definition code for java.awt.Color  selectionBackground)
Sets the background color for selected cells. Cell renderers can use this color to the fill selected cells.

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

This is a JavaBeans bound property.

Parameters:
selectionBackground - the Color to use for the background of selected cells
See Also:
getSelectionBackground() sample code for javax.swing.JTable.getSelectionBackground() definition code for javax.swing.JTable.getSelectionBackground() , setSelectionForeground(java.awt.Color) sample code for javax.swing.JTable.setSelectionForeground(java.awt.Color) definition code for javax.swing.JTable.setSelectionForeground(java.awt.Color) , JComponent.setForeground(java.awt.Color) sample code for javax.swing.JComponent.setForeground(java.awt.Color) definition code for javax.swing.JComponent.setForeground(java.awt.Color) , JComponent.setBackground(java.awt.Color) sample code for javax.swing.JComponent.setBackground(java.awt.Color) definition code for javax.swing.JComponent.setBackground(java.awt.Color) , JComponent.setFont(java.awt.Font) sample code for javax.swing.JComponent.setFont(java.awt.Font) definition code for javax.swing.JComponent.setFont(java.awt.Font)

getColumn sample code for javax.swing.JTable.getColumn(java.lang.Object) definition code for javax.swing.JTable.getColumn(java.lang.Object)

public TableColumn sample code for javax.swing.table.TableColumn definition code for javax.swing.table.TableColumn  getColumn(Object sample code for java.lang.Object definition code for java.lang.Object  identifier)
Returns the TableColumn object for the column in the table whose identifier is equal to identifier, when compared using equals.

Parameters:
identifier - the identifier object
Returns:
the TableColumn object that matches the identifier
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if identifier is null or no TableColumn has this identifier

convertColumnIndexToModel sample code for javax.swing.JTable.convertColumnIndexToModel(int) definition code for javax.swing.JTable.convertColumnIndexToModel(int)

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

Parameters:
viewColumnIndex - the index of the column in the view
Returns:
the index of the corresponding column in the model
See Also:
convertColumnIndexToView(int) sample code for javax.swing.JTable.convertColumnIndexToView(int) definition code for javax.swing.JTable.convertColumnIndexToView(int)

convertColumnIndexToView sample code for javax.swing.JTable.convertColumnIndexToView(int) definition code for javax.swing.JTable.convertColumnIndexToView(int)

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

Parameters:
modelColumnIndex - the index of the column in the model
Returns:
the index of the corresponding column in the view
See Also:
convertColumnIndexToModel(int) sample code for javax.swing.JTable.convertColumnIndexToModel(int) definition code for javax.swing.JTable.convertColumnIndexToModel(int)

getRowCount sample code for javax.swing.JTable.getRowCount() definition code for javax.swing.JTable.getRowCount()

public int getRowCount()
Returns the number of rows in this table's model.

Returns:
the number of rows in this table's model
See Also:
getColumnCount() sample code for javax.swing.JTable.getColumnCount() definition code for javax.swing.JTable.getColumnCount()

getColumnCount sample code for javax.swing.JTable.getColumnCount() definition code for javax.swing.JTable.getColumnCount()

public int getColumnCount()
Returns the number of columns in the column model. Note that this may be different from the number of columns in the table model.

Returns:
the number of columns in the table
See Also:
getRowCount() sample code for javax.swing.JTable.getRowCount() definition code for javax.swing.JTable.getRowCount() , removeColumn(javax.swing.table.TableColumn) sample code for javax.swing.JTable.removeColumn(javax.swing.table.TableColumn) definition code for javax.swing.JTable.removeColumn(javax.swing.table.TableColumn)

getColumnName sample code for javax.swing.JTable.getColumnName(int) definition code for javax.swing.JTable.getColumnName(int)

public String sample code for java.lang.String definition code for java.lang.String  getColumnName(int column)
Returns the name of the column appearing in the view at column position column.

Parameters:
column - the column in the view being queried
Returns:
the name of the column at position column in the view where the first column is column 0

getColumnClass sample code for javax.swing.JTable.getColumnClass(int) definition code for javax.swing.JTable.getColumnClass(int)

public Class sample code for java.lang.Class definition code for java.lang.Class <?> getColumnClass(int column)
Returns the type of the column appearing in the view at column position column.

Parameters:
column - the column in the view being queried
Returns:
the type of the column at position column in the view where the first column is column 0

getValueAt sample code for javax.swing.JTable.getValueAt(int, int) definition code for javax.swing.JTable.getValueAt(int, int)

public Object sample code for java.lang.Object definition code for java.lang.Object  getValueAt(int row,
                         int column)
Returns the cell value at row and column.

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

Parameters:
row - the row whose value is to be queried
column - the column whose value is to be queried
Returns:
the Object at the specified cell

setValueAt sample code for javax.swing.JTable.setValueAt(java.lang.Object, int, int) definition code for javax.swing.JTable.setValueAt(java.lang.Object, int, int)

public void setValueAt(Object sample code for java.lang.Object definition code for java.lang.Object  aValue,
                       int row,
                       int column)
Sets the value for the cell in the table model at row and column.

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

Parameters:
aValue - the new value
row - the row of the cell to be changed
column - the column of the cell to be changed
See Also:
getValueAt(int, int) sample code for javax.swing.JTable.getValueAt(int, int) definition code for javax.swing.JTable.getValueAt(int, int)

isCellEditable sample code for javax.swing.JTable.isCellEditable(int, int) definition code for javax.swing.JTable.isCellEditable(int, int)

public boolean isCellEditable(int row,
                              int column)
Returns true if the cell at row and column is editable. Otherwise, invoking setValueAt on the cell will have no effect.

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

Parameters:
row - the row whose value is to be queried
column - the column whose value is to be queried
Returns:
true if the cell is editable
See Also:
setValueAt(java.lang.Object, int, int) sample code for javax.swing.JTable.setValueAt(java.lang.Object, int, int) definition code for javax.swing.JTable.setValueAt(java.lang.Object, int, int)

addColumn sample code for javax.swing.JTable.addColumn(javax.swing.table.TableColumn) definition code for javax.swing.JTable.addColumn(javax.swing.table.TableColumn)

public void addColumn(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. If the column name of aColumn is null, sets the column name of aColumn to the name returned by getModel().getColumnName().

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


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

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

Parameters:
aColumn - the TableColumn to be added
See Also:
removeColumn(javax.swing.table.TableColumn) sample code for javax.swing.JTable.removeColumn(javax.swing.table.TableColumn) definition code for javax.swing.JTable.removeColumn(javax.swing.table.TableColumn)

removeColumn sample code for javax.swing.JTable.removeColumn(javax.swing.table.TableColumn) definition code for javax.swing.JTable.removeColumn(javax.swing.table.TableColumn)

public void removeColumn(TableColumn sample code for javax.swing.table.TableColumn definition code for javax.swing.table.TableColumn  aColumn)
Removes aColumn from this JTable's array of columns. Note: this method does not remove the column of data from the model; it just removes the TableColumn that was responsible for displaying it.

Parameters:
aColumn - the TableColumn to be removed
See Also:
addColumn(javax.swing.table.TableColumn) sample code for javax.swing.JTable.addColumn(javax.swing.table.TableColumn) definition code for javax.swing.JTable.addColumn(javax.swing.table.TableColumn)

moveColumn sample code for javax.swing.JTable.moveColumn(int, int) definition code for javax.swing.JTable.moveColumn(int, int)

public void moveColumn(int column,
                       int targetColumn)
Moves the column column to the position currently occupied by the column targetColumn in the view. The old column at targetColumn is shifted left or right to make room.

Parameters:
column - the index of column to be moved
targetColumn - the new index of the column

columnAtPoint sample code for javax.swing.JTable.columnAtPoint(java.awt.Point) definition code for javax.swing.JTable.columnAtPoint(java.awt.Point)

public int columnAtPoint(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].

Parameters:
point - the location of interest
Returns:
the index of the column that point lies in, or -1 if the result is not in the range [0, getColumnCount()-1]
See Also:
rowAtPoint(java.awt.Point) sample code for javax.swing.JTable.rowAtPoint(java.awt.Point) definition code for javax.swing.JTable.rowAtPoint(java.awt.Point)

rowAtPoint sample code for javax.swing.JTable.rowAtPoint(java.awt.Point) definition code for javax.swing.JTable.rowAtPoint(java.awt.Point)

public int rowAtPoint(Point sample code for java.awt.Point definition code for java.awt.Point  point)
Returns the index of the row that point lies in, or -1 if the result is not in the range [0, getRowCount()-1].

Parameters:
point - the location of interest
Returns:
the index of the row that point lies in, or -1 if the result is not in the range [0, getRowCount()-1]
See Also:
columnAtPoint(java.awt.Point) sample code for javax.swing.JTable.columnAtPoint(java.awt.Point) definition code for javax.swing.JTable.columnAtPoint(java.awt.Point)

getCellRect sample code for javax.swing.JTable.getCellRect(int, int, boolean) definition code for javax.swing.JTable.getCellRect(int, int, boolean)

public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getCellRect(int row,
                             int column,
                             boolean includeSpacing)
Returns a rectangle for the cell that lies at the intersection of row and column. If includeSpacing is true then the value returned has the full height and width of the row and column specified. If it is false, the returned rectangle is inset by the intercell spacing to return the true bounds of the rendering or editing component as it will be set during rendering.

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

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

Parameters:
row - the row index where the desired cell is located
column - the column index where the desired cell is located in the display; this is not necessarily the same as the column index in the data model for the table; the convertColumnIndexToView(int) sample code for javax.swing.JTable.convertColumnIndexToView(int) definition code for javax.swing.JTable.convertColumnIndexToView(int) method may be used to convert a data model column index to a display column index
includeSpacing - if false, return the true cell bounds - computed by subtracting the intercell spacing from the height and widths of the column and row models
Returns:
the rectangle containing the cell at location row,column

doLayout sample code for javax.swing.JTable.doLayout() definition code for javax.swing.JTable.doLayout()

public void doLayout()
Causes this table to lay out its rows and columns. Overridden so that columns can be resized to accomodate a change in the size of a containing parent. Resizes one or more of the columns in the table so that the total width of all of this JTable's columns is equal to the width of the table.

Before the layout begins the method gets the resizingColumn of the tableHeader. When the method is called as a result of the resizing of an enclosing window, the resizingColumn is null. This means that resizing has taken place "outside" the JTable and the change - or "delta" - should be distributed to all of the columns regardless of this JTable's automatic resize mode.

If the resizingColumn is not null, it is one of the columns in the table that has changed size rather than the table itself. In this case the auto-resize modes govern the way the extra (or deficit) space is distributed amongst the available columns.

The modes are:

Note: When a JTable makes adjustments to the widths of the columns it respects their minimum and maximum values absolutely. It is therefore possible that, even after this method is called, the total width of the columns is still not equal to the width of the table. When this happens the JTable does not put itself in AUTO_RESIZE_OFF mode to bring up a scroll bar, or break other commitments of its current auto-resize mode -- instead it allows its bounds to be set larger (or smaller) than the total of the column minimum or maximum, meaning, either that there will not be enough room to display all of the columns, or that the columns will not fill the JTable's bounds. These respectively, result in the clipping of some columns or an area being painted in the JTable's background color during painting.

The mechanism for distributing the delta amongst the available columns is provided in a private method in the JTable class:

   adjustSizes(long targetSize, final Resizable3 r, boolean inverse)
 
an explanation of which is provided in the following section. Resizable3 is a private interface that allows any data structure containing a collection of elements with a size, preferred size, maximum size and minimum size to have its elements manipulated by the algorithm.

Distributing the delta

Overview

Call "DELTA" the difference between the target size and the sum of the preferred sizes of the elements in r. The individual sizes are calculated by taking the original preferred sizes and adding a share of the DELTA - that share being based on how far each preferred size is from its limiting bound (minimum or maximum).

Definition

Call the individual constraints min[i], max[i], and pref[i].

Call their respective sums: MIN, MAX, and PREF.

Each new size will be calculated using:

          size[i] = pref[i] + delta[i]
 
where each individual delta[i] is calculated according to:

If (DELTA < 0) we are in shrink mode where:

                        DELTA
          delta[i] = ------------ * (pref[i] - min[i])
                     (PREF - MIN)
 
If (DELTA > 0) we are in expand mode where:

                        DELTA
          delta[i] = ------------ * (max[i] - pref[i])
                      (MAX - PREF)
 

The overall effect is that the total size moves that same percentage, k, towards the total minimum or maximum and that percentage guarantees accomodation of the required space, DELTA.

Details

Naive evaluation of the formulae presented here would be subject to the aggregated rounding errors caused by doing this operation in finite precision (using ints). To deal with this, the multiplying factor above, is constantly recalculated and this takes account of the rounding errors in the previous iterations. The result is an algorithm that produces a set of integers whose values exactly sum to the supplied targetSize, and does so by spreading the rounding errors evenly over the given elements.

When the MAX and MIN bounds are hit

When targetSize is outside the [MIN, MAX] range, the algorithm sets all sizes to their appropriate limiting value (maximum or minimum).

Overrides:
doLayout sample code for java.awt.Container.doLayout() definition code for java.awt.Container.doLayout() in class Container sample code for java.awt.Container definition code for java.awt.Container
See Also:
LayoutManager.layoutContainer(java.awt.Container) sample code for java.awt.LayoutManager.layoutContainer(java.awt.Container) definition code for java.awt.LayoutManager.layoutContainer(java.awt.Container) , Container.setLayout(java.awt.LayoutManager) sample code for java.awt.Container.setLayout(java.awt.LayoutManager) definition code for java.awt.Container.setLayout(java.awt.LayoutManager) , Container.validate() sample code for java.awt.Container.validate() definition code for java.awt.Container.validate()

sizeColumnsToFit sample code for javax.swing.JTable.sizeColumnsToFit(boolean) definition code for javax.swing.JTable.sizeColumnsToFit(boolean)

@Deprecated
public void sizeColumnsToFit(boolean lastColumnOnly)
Deprecated. As of Swing version 1.0.3, replaced by doLayout().

Sizes the table columns to fit the available space.

See Also:
doLayout() sample code for javax.swing.JTable.doLayout() definition code for javax.swing.JTable.doLayout()

sizeColumnsToFit sample code for javax.swing.JTable.sizeColumnsToFit(int) definition code for javax.swing.JTable.sizeColumnsToFit(int)

public void sizeColumnsToFit(int resizingColumn)
Obsolete as of Java 2 platform v1.4. Please use the doLayout() method instead.

Parameters:
resizingColumn - the column whose resizing made this adjustment necessary or -1 if there is no such column
See Also:
doLayout() sample code for javax.swing.JTable.doLayout() definition code for javax.swing.JTable.doLayout()

getToolTipText sample code for javax.swing.JTable.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JTable.getToolTipText(java.awt.event.MouseEvent)

public String sample code for java.lang.String definition code for java.lang.String  getToolTipText(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
Overrides JComponent's getToolTipText method in order to allow the renderer's tips to be used if it has text set.

Note: For JTable to properly display tooltips of its renderers JTable must be a registered component with the ToolTipManager. This is done automatically in initializeLocalVars, but if at a later point JTable is told setToolTipText(null) it will unregister the table component, and no tips from renderers will display anymore.

Overrides:
getToolTipText sample code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
See Also:
JComponent.getToolTipText() sample code for javax.swing.JComponent.getToolTipText() definition code for javax.swing.JComponent.getToolTipText()

setSurrendersFocusOnKeystroke sample code for javax.swing.JTable.setSurrendersFocusOnKeystroke(boolean) definition code for javax.swing.JTable.setSurrendersFocusOnKeystroke(boolean)

public void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke)
Sets whether editors in this JTable get the keyboard focus when an editor is activated as a result of the JTable forwarding keyboard events for a cell. By default, this property is false, and the JTable retains the focus unless the cell is clicked.

Parameters:
surrendersFocusOnKeystroke - true if the editor should get the focus when keystrokes cause the editor to be activated
See Also:
getSurrendersFocusOnKeystroke() sample code for javax.swing.JTable.getSurrendersFocusOnKeystroke() definition code for javax.swing.JTable.getSurrendersFocusOnKeystroke()

getSurrendersFocusOnKeystroke sample code for javax.swing.JTable.getSurrendersFocusOnKeystroke() definition code for javax.swing.JTable.getSurrendersFocusOnKeystroke()

public boolean getSurrendersFocusOnKeystroke()
Returns true if the editor should get the focus when keystrokes cause the editor to be activated

Returns:
true if the editor should get the focus when keystrokes cause the editor to be activated
See Also:
setSurrendersFocusOnKeystroke(boolean) sample code for javax.swing.JTable.setSurrendersFocusOnKeystroke(boolean) definition code for javax.swing.JTable.setSurrendersFocusOnKeystroke(boolean)

editCellAt sample code for javax.swing.JTable.editCellAt(int, int) definition code for javax.swing.JTable.editCellAt(int, int)

public boolean editCellAt(int row,
                          int column)
Programmatically starts editing the cell at row and column, if those indices are in the valid range, and the cell at those indices is editable. Note that this is a convenience method for editCellAt(int, int, null).

Parameters:
row - the row to be edited
column - the column to be edited
Returns:
false if for any reason the cell cannot be edited, or if the indices are invalid

editCellAt sample code for javax.swing.JTable.editCellAt(int, int, java.util.EventObject) definition code for javax.swing.JTable.editCellAt(int, int, java.util.EventObject)

public boolean editCellAt(int row,
                          int column,
                          EventObject sample code for java.util.EventObject definition code for java.util.EventObject  e)
Programmatically starts editing the cell at row and column, if those indices are in the valid range, and the cell at those indices is editable. To prevent the JTable from editing a particular table, column or cell value, return false from the isCellEditable method in the TableModel interface.

Parameters:
row - the row to be edited
column - the column to be edited
e - event to pass into shouldSelectCell; note that as of Java 2 platform v1.2, the call to shouldSelectCell is no longer made
Returns:
false if for any reason the cell cannot be edited, or if the indices are invalid

isEditing sample code for javax.swing.JTable.isEditing() definition code for javax.swing.JTable.isEditing()

public boolean isEditing()
Returns true if a cell is being edited.

Returns:
true if the table is editing a cell
See Also:
editingColumn sample code for javax.swing.JTable.editingColumn definition code for javax.swing.JTable.editingColumn , editingRow sample code for javax.swing.JTable.editingRow definition code for javax.swing.JTable.editingRow

getEditorComponent sample code for javax.swing.JTable.getEditorComponent() definition code for javax.swing.JTable.getEditorComponent()

public Component sample code for java.awt.Component definition code for java.awt.Component  getEditorComponent()
Returns the component that is handling the editing session. If nothing is being edited, returns null.

Returns:
Component handling editing session

getEditingColumn sample code for javax.swing.JTable.getEditingColumn() definition code for javax.swing.JTable.getEditingColumn()

public int getEditingColumn()
Returns the index of the column that contains the cell currently being edited. If nothing is being edited, returns -1.

Returns:
the index of the column that contains the cell currently being edited; returns -1 if nothing being edited
See Also:
editingRow sample code for javax.swing.JTable.editingRow definition code for javax.swing.JTable.editingRow

getEditingRow sample code for javax.swing.JTable.getEditingRow() definition code for javax.swing.JTable.getEditingRow()

public int getEditingRow()
Returns the index of the row that contains the cell currently being edited. If nothing is being edited, returns -1.

Returns:
the index of the row that contains the cell currently being edited; returns -1 if nothing being edited
See Also:
editingColumn sample code for javax.swing.JTable.editingColumn definition code for javax.swing.JTable.editingColumn

getUI sample code for javax.swing.JTable.getUI() definition code for javax.swing.JTable.getUI()

public TableUI sample code for javax.swing.plaf.TableUI definition code for javax.swing.plaf.TableUI  getUI()
Returns the L&F object that renders this component.

Returns:
the TableUI object that renders this component

setUI sample code for javax.swing.JTable.setUI(javax.swing.plaf.TableUI) definition code for javax.swing.JTable.setUI(javax.swing.plaf.TableUI)

public void setUI(TableUI sample code for javax.swing.plaf.TableUI definition code for javax.swing.plaf.TableUI  ui)
Sets the L&F object that renders this component and repaints.

Parameters:
ui - the TableUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent) sample code for javax.swing.UIDefaults.getUI(javax.swing.JComponent) definition code for javax.swing.UIDefaults.getUI(javax.swing.JComponent)

updateUI sample code for javax.swing.JTable.updateUI() definition code for javax.swing.JTable.updateUI()

public void updateUI()
Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager.

Overrides:
updateUI sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
See Also:
JComponent.updateUI() sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI()

getUIClassID sample code for javax.swing.JTable.getUIClassID() definition code for javax.swing.JTable.getUIClassID()

public String sample code for java.lang.String definition code for java.lang.String  getUIClassID()
Returns the suffix used to construct the name of the L&F class used to render this component.

Overrides:
getUIClassID sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
the string "TableUI"
See Also:
JComponent.getUIClassID() sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() , UIDefaults.getUI(javax.swing.JComponent) sample code for javax.swing.UIDefaults.getUI(javax.swing.JComponent) definition code for javax.swing.UIDefaults.getUI(javax.swing.JComponent)

setModel sample code for javax.swing.JTable.setModel(javax.swing.table.TableModel) definition code for javax.swing.JTable.setModel(javax.swing.table.TableModel)

public void setModel(TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel  dataModel)
Sets the data model for this table to newModel and registers with it for listener notifications from the new data model.

Parameters:
dataModel - the new data source for this table
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if newModel is null
See Also:
getModel() sample code for javax.swing.JTable.getModel() definition code for javax.swing.JTable.getModel()

getModel sample code for javax.swing.JTable.getModel() definition code for javax.swing.JTable.getModel()

public TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel  getModel()
Returns the TableModel that provides the data displayed by this JTable.

Returns:
the TableModel that provides the data displayed by this JTable
See Also:
setModel(javax.swing.table.TableModel) sample code for javax.swing.JTable.setModel(javax.swing.table.TableModel) definition code for javax.swing.JTable.setModel(javax.swing.table.TableModel)

setColumnModel sample code for javax.swing.JTable.setColumnModel(javax.swing.table.TableColumnModel) definition code for javax.swing.JTable.setColumnModel(javax.swing.table.TableColumnModel)

public void setColumnModel(TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel  columnModel)
Sets the column model for this table to newModel and registers for listener notifications from the new column model. Also sets the column model of the JTableHeader to columnModel.

Parameters:
columnModel - the new data source for this table
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if columnModel is null
See Also:
getColumnModel() sample code for javax.swing.JTable.getColumnModel() definition code for javax.swing.JTable.getColumnModel()

getColumnModel sample code for javax.swing.JTable.getColumnModel() definition code for javax.swing.JTable.getColumnModel()

public TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel  getColumnModel()
Returns the TableColumnModel that contains all column information of this table.

Returns:
the object that provides the column state of the table
See Also:
setColumnModel(javax.swing.table.TableColumnModel) sample code for javax.swing.JTable.setColumnModel(javax.swing.table.TableColumnModel) definition code for javax.swing.JTable.setColumnModel(javax.swing.table.TableColumnModel)

setSelectionModel sample code for javax.swing.JTable.setSelectionModel(javax.swing.ListSelectionModel) definition code for javax.swing.JTable.setSelectionModel(javax.swing.ListSelectionModel)

public void setSelectionModel(ListSelectionModel sample code for javax.swing.ListSelectionModel definition code for javax.swing.ListSelectionModel  newModel)
Sets the row selection model for this table to newModel and registers for listener notifications from the new selection model.

Parameters:
newModel - the new selection model
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if newModel is null
See Also:
getSelectionModel() sample code for javax.swing.JTable.getSelectionModel() definition code for javax.swing.JTable.getSelectionModel()

getSelectionModel sample code for javax.swing.JTable.getSelectionModel() definition code for javax.swing.JTable.getSelectionModel()

public ListSelectionModel sample code for javax.swing.ListSelectionModel definition code for javax.swing.ListSelectionModel  getSelectionModel()
Returns the ListSelectionModel that is used to maintain row selection state.

Returns:
the object that provides row selection state, null if row selection is not allowed
See Also:
setSelectionModel(javax.swing.ListSelectionModel) sample code for javax.swing.JTable.setSelectionModel(javax.swing.ListSelectionModel) definition code for javax.swing.JTable.setSelectionModel(javax.swing.ListSelectionModel)

tableChanged sample code for javax.swing.JTable.tableChanged(javax.swing.event.TableModelEvent) definition code for javax.swing.JTable.tableChanged(javax.swing.event.TableModelEvent)

public void tableChanged(TableModelEvent sample code for javax.swing.event.TableModelEvent definition code for javax.swing.event.TableModelEvent  e)
Invoked when this table's TableModel generates a TableModelEvent. The TableModelEvent should be constructed in the coordinate system of the model; the appropriate mapping to the view coordinate system is performed by this JTable when it receives the event.

Application code will not use these methods explicitly, they are used internally by JTable.

Note that as of 1.3, this method clears the selection, if any.

Specified by:
tableChanged sample code for javax.swing.event.TableModelListener.tableChanged(javax.swing.event.TableModelEvent) definition code for javax.swing.event.TableModelListener.tableChanged(javax.swing.event.TableModelEvent) in interface TableModelListener sample code for javax.swing.event.TableModelListener definition code for javax.swing.event.TableModelListener

columnAdded sample code for javax.swing.JTable.columnAdded(javax.swing.event.TableColumnModelEvent) definition code for javax.swing.JTable.columnAdded(javax.swing.event.TableColumnModelEvent)

public void columnAdded(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.

Application code will not use these methods explicitly, they are used internally by JTable.

Specified by:
columnAdded sample code for javax.swing.event.TableColumnModelListener.columnAdded(javax.swing.event.TableColumnModelEvent) definition code for javax.swing.event.TableColumnModelListener.columnAdded(javax.swing.event.TableColumnModelEvent) in interface TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener
See Also:
TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener

columnRemoved sample code for javax.swing.JTable.columnRemoved(javax.swing.event.TableColumnModelEvent) definition code for javax.swing.JTable.columnRemoved(javax.swing.event.TableColumnModelEvent)

public void columnRemoved(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.

Application code will not use these methods explicitly, they are used internally by JTable.

Specified by:
columnRemoved sample code for javax.swing.event.TableColumnModelListener.columnRemoved(javax.swing.event.TableColumnModelEvent) definition code for javax.swing.event.TableColumnModelListener.columnRemoved(javax.swing.event.TableColumnModelEvent) in interface TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener
See Also:
TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener

columnMoved sample code for javax.swing.JTable.columnMoved(javax.swing.event.TableColumnModelEvent) definition code for javax.swing.JTable.columnMoved(javax.swing.event.TableColumnModelEvent)

public void columnMoved(TableColumnModelEvent sample code for javax.swing.event.TableColumnModelEvent definition code for javax.swing.event.TableColumnModelEvent  e)
Invoked when a column is repositioned. If a cell is being edited, then editing is stopped and the cell is redrawn.

Application code will not use these methods explicitly, they are used internally by JTable.

Specified by:
columnMoved sample code for javax.swing.event.TableColumnModelListener.columnMoved(javax.swing.event.TableColumnModelEvent) definition code for javax.swing.event.TableColumnModelListener.columnMoved(javax.swing.event.TableColumnModelEvent) in interface TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener
Parameters:
e - the event received
See Also:
TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener

columnMarginChanged sample code for javax.swing.JTable.columnMarginChanged(javax.swing.event.ChangeEvent) definition code for javax.swing.JTable.columnMarginChanged(javax.swing.event.ChangeEvent)

public void columnMarginChanged(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. If a cell is being edited, then editing is stopped and the cell is redrawn.

Application code will not use these methods explicitly, they are used internally by JTable.

Specified by:
columnMarginChanged sample code for javax.swing.event.TableColumnModelListener.columnMarginChanged(javax.swing.event.ChangeEvent) definition code for javax.swing.event.TableColumnModelListener.columnMarginChanged(javax.swing.event.ChangeEvent) in interface TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener
Parameters:
e - the event received
See Also:
TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener

columnSelectionChanged sample code for javax.swing.JTable.columnSelectionChanged(javax.swing.event.ListSelectionEvent) definition code for javax.swing.JTable.columnSelectionChanged(javax.swing.event.ListSelectionEvent)

public void columnSelectionChanged(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.

Application code will not use these methods explicitly, they are used internally by JTable.

Specified by:
columnSelectionChanged sample code for javax.swing.event.TableColumnModelListener.columnSelectionChanged(javax.swing.event.ListSelectionEvent) definition code for javax.swing.event.TableColumnModelListener.columnSelectionChanged(javax.swing.event.ListSelectionEvent) in interface TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener
Parameters:
e - the event received
See Also:
TableColumnModelListener sample code for javax.swing.event.TableColumnModelListener definition code for javax.swing.event.TableColumnModelListener

valueChanged sample code for javax.swing.JTable.valueChanged(javax.swing.event.ListSelectionEvent) definition code for javax.swing.JTable.valueChanged(javax.swing.event.ListSelectionEvent)

public void valueChanged(ListSelectionEvent sample code for javax.swing.event.ListSelectionEvent definition code for javax.swing.event.ListSelectionEvent  e)
Invoked when the row selection changes -- repaints to show the new selection.

Application code will not use these methods explicitly, they are used internally by JTable.

Specified by:
valueChanged sample code for javax.swing.event.ListSelectionListener.valueChanged(javax.swing.event.ListSelectionEvent) definition code for javax.swing.event.ListSelectionListener.valueChanged(javax.swing.event.ListSelectionEvent) in interface ListSelectionListener sample code for javax.swing.event.ListSelectionListener definition code for javax.swing.event.ListSelectionListener
Parameters:
e - the event received
See Also:
ListSelectionListener sample code for javax.swing.event.ListSelectionListener definition code for javax.swing.event.ListSelectionListener

editingStopped sample code for javax.swing.JTable.editingStopped(javax.swing.event.ChangeEvent) definition code for javax.swing.JTable.editingStopped(javax.swing.event.ChangeEvent)

public void editingStopped(ChangeEvent sample code for javax.swing.event.ChangeEvent definition code for javax.swing.event.ChangeEvent  e)
Invoked when editing is finished. The changes are saved and the editor is discarded.

Application code will not use these methods explicitly, they are used internally by JTable.

Specified by:
editingStopped sample code for javax.swing.event.CellEditorListener.editingStopped(javax.swing.event.ChangeEvent) definition code for javax.swing.event.CellEditorListener.editingStopped(javax.swing.event.ChangeEvent) in interface CellEditorListener sample code for javax.swing.event.CellEditorListener definition code for javax.swing.event.CellEditorListener
Parameters:
e - the event received
See Also:
CellEditorListener sample code for javax.swing.event.CellEditorListener definition code for javax.swing.event.CellEditorListener

editingCanceled sample code for javax.swing.JTable.editingCanceled(javax.swing.event.ChangeEvent) definition code for javax.swing.JTable.editingCanceled(javax.swing.event.ChangeEvent)

public void editingCanceled(ChangeEvent sample code for javax.swing.event.ChangeEvent definition code for javax.swing.event.ChangeEvent  e)
Invoked when editing is canceled. The editor object is discarded and the cell is rendered once again.

Application code will not use these methods explicitly, they are used internally by JTable.

Specified by:
editingCanceled sample code for javax.swing.event.CellEditorListener.editingCanceled(javax.swing.event.ChangeEvent) definition code for javax.swing.event.CellEditorListener.editingCanceled(javax.swing.event.ChangeEvent) in interface CellEditorListener sample code for javax.swing.event.CellEditorListener definition code for javax.swing.event.CellEditorListener
Parameters:
e - the event received
See Also:
CellEditorListener sample code for javax.swing.event.CellEditorListener definition code for javax.swing.event.CellEditorListener

setPreferredScrollableViewportSize sample code for javax.swing.JTable.setPreferredScrollableViewportSize(java.awt.Dimension) definition code for javax.swing.JTable.setPreferredScrollableViewportSize(java.awt.Dimension)

public void setPreferredScrollableViewportSize(Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  size)
Sets the preferred size of the viewport for this table.

Parameters:
size - a Dimension object specifying the preferredSize of a JViewport whose view is this table
See Also:
Scrollable.getPreferredScrollableViewportSize() sample code for javax.swing.Scrollable.getPreferredScrollableViewportSize() definition code for javax.swing.Scrollable.getPreferredScrollableViewportSize()

getPreferredScrollableViewportSize sample code for javax.swing.JTable.getPreferredScrollableViewportSize() definition code for javax.swing.JTable.getPreferredScrollableViewportSize()

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this table.

Specified by:
getPreferredScrollableViewportSize sample code for javax.swing.Scrollable.getPreferredScrollableViewportSize() definition code for javax.swing.Scrollable.getPreferredScrollableViewportSize() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Returns:
a Dimension object containing the preferredSize of the JViewport which displays this table
See Also:
Scrollable.getPreferredScrollableViewportSize() sample code for javax.swing.Scrollable.getPreferredScrollableViewportSize() definition code for javax.swing.Scrollable.getPreferredScrollableViewportSize()

getScrollableUnitIncrement sample code for javax.swing.JTable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.JTable.getScrollableUnitIncrement(java.awt.Rectangle, int, int)

public int getScrollableUnitIncrement(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect,
                                      int orientation,
                                      int direction)
Returns the scroll increment (in pixels) that completely exposes one new row or column (depending on the orientation).

This method is called each time the user requests a unit scroll.

Specified by:
getScrollableUnitIncrement sample code for javax.swing.Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Parameters:
visibleRect - the view area visible within the viewport
orientation - either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL
direction - less than zero to scroll up/left, greater than zero for down/right
Returns:
the "unit" increment for scrolling in the specified direction
See Also:
Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) sample code for javax.swing.Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int)

getScrollableBlockIncrement sample code for javax.swing.JTable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.JTable.getScrollableBlockIncrement(java.awt.Rectangle, int, int)

public int getScrollableBlockIncrement(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect,
                                       int orientation,
                                       int direction)
Returns visibleRect.height or visibleRect.width, depending on this table's orientation. Note that as of Swing 1.1.1 (Java 2 v 1.2.2) the value returned will ensure that the viewport is cleanly aligned on a row boundary.

Specified by:
getScrollableBlockIncrement sample code for javax.swing.Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Parameters:
visibleRect - The view area visible within the viewport
orientation - Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.
direction - Less than zero to scroll up/left, greater than zero for down/right.
Returns:
visibleRect.height or visibleRect.width per the orientation
See Also:
Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) sample code for javax.swing.Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int) definition code for javax.swing.Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int)

getScrollableTracksViewportWidth sample code for javax.swing.JTable.getScrollableTracksViewportWidth() definition code for javax.swing.JTable.getScrollableTracksViewportWidth()

public boolean getScrollableTracksViewportWidth()
Returns false if autoResizeMode is set to AUTO_RESIZE_OFF, which indicates that the width of the viewport does not determine the width of the table. Otherwise returns true.

Specified by:
getScrollableTracksViewportWidth sample code for javax.swing.Scrollable.getScrollableTracksViewportWidth() definition code for javax.swing.Scrollable.getScrollableTracksViewportWidth() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Returns:
false if autoResizeMode is set to AUTO_RESIZE_OFF, otherwise returns true
See Also:
Scrollable.getScrollableTracksViewportWidth() sample code for javax.swing.Scrollable.getScrollableTracksViewportWidth() definition code for javax.swing.Scrollable.getScrollableTracksViewportWidth()

getScrollableTracksViewportHeight sample code for javax.swing.JTable.getScrollableTracksViewportHeight() definition code for javax.swing.JTable.getScrollableTracksViewportHeight()

public boolean getScrollableTracksViewportHeight()
Returns false to indicate that the height of the viewport does not determine the height of the table.

Specified by:
getScrollableTracksViewportHeight sample code for javax.swing.Scrollable.getScrollableTracksViewportHeight() definition code for javax.swing.Scrollable.getScrollableTracksViewportHeight() in interface Scrollable sample code for javax.swing.Scrollable definition code for javax.swing.Scrollable
Returns:
false
See Also:
Scrollable.getScrollableTracksViewportHeight() sample code for javax.swing.Scrollable.getScrollableTracksViewportHeight() definition code for javax.swing.Scrollable.getScrollableTracksViewportHeight()

processKeyBinding sample code for javax.swing.JTable.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JTable.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean)

protected boolean processKeyBinding(KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  ks,
                                    KeyEvent sample code for java.awt.event.KeyEvent definition code for java.awt.event.KeyEvent  e,
                                    int condition,
                                    boolean pressed)
Description copied from class: JComponent sample code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean)
Invoked to process the key bindings for ks as the result of the KeyEvent e. This obtains the appropriate InputMap, gets the binding, gets the action from the ActionMap, and then (if the action is found and the component is enabled) invokes notifyAction to notify the action.

Overrides:
processKeyBinding sample code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Parameters:
ks - the KeyStroke queried
e - the KeyEvent
condition - one of the following values:
  • JComponent.WHEN_FOCUSED
  • JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
  • JComponent.WHEN_IN_FOCUSED_WINDOW
pressed - true if the key is pressed
Returns:
true if there was a binding to an action, and the action was enabled

createDefaultRenderers sample code for javax.swing.JTable.createDefaultRenderers() definition code for javax.swing.JTable.createDefaultRenderers()

protected void createDefaultRenderers()
Creates default cell renderers for objects, numbers, doubles, dates, booleans, and icons.

See Also:
DefaultTableCellRenderer sample code for javax.swing.table.DefaultTableCellRenderer definition code for javax.swing.table.DefaultTableCellRenderer

createDefaultEditors sample code for javax.swing.JTable.createDefaultEditors() definition code for javax.swing.JTable.createDefaultEditors()

protected void createDefaultEditors()
Creates default cell editors for objects, numbers, and boolean values.

See Also:
DefaultCellEditor sample code for javax.swing.DefaultCellEditor definition code for javax.swing.DefaultCellEditor

initializeLocalVars sample code for javax.swing.JTable.initializeLocalVars() definition code for javax.swing.JTable.initializeLocalVars()

protected void initializeLocalVars()
Initializes table properties to their default values.


createDefaultDataModel sample code for javax.swing.JTable.createDefaultDataModel() definition code for javax.swing.JTable.createDefaultDataModel()

protected TableModel sample code for javax.swing.table.TableModel definition code for javax.swing.table.TableModel  createDefaultDataModel()
Returns the default table model object, which is a DefaultTableModel. A subclass can override this method to return a different table model object.

Returns:
the default table model object
See Also:
DefaultTableModel sample code for javax.swing.table.DefaultTableModel definition code for javax.swing.table.DefaultTableModel

createDefaultColumnModel sample code for javax.swing.JTable.createDefaultColumnModel() definition code for javax.swing.JTable.createDefaultColumnModel()

protected TableColumnModel sample code for javax.swing.table.TableColumnModel definition code for javax.swing.table.TableColumnModel  createDefaultColumnModel()
Returns the default column model object, which is a DefaultTableColumnModel. A subclass can override this method to return a different column model object.

Returns:
the default column model object
See Also:
DefaultTableColumnModel sample code for javax.swing.table.DefaultTableColumnModel definition code for javax.swing.table.DefaultTableColumnModel

createDefaultSelectionModel sample code for javax.swing.JTable.createDefaultSelectionModel() definition code for javax.swing.JTable.createDefaultSelectionModel()

protected ListSelectionModel sample code for javax.swing.ListSelectionModel definition code for javax.swing.ListSelectionModel  createDefaultSelectionModel()
Returns the default selection model object, which is a DefaultListSelectionModel. A subclass can override this method to return a different selection model object.

Returns:
the default selection model object
See Also:
DefaultListSelectionModel sample code for javax.swing.DefaultListSelectionModel definition code for javax.swing.DefaultListSelectionModel

createDefaultTableHeader sample code for javax.swing.JTable.createDefaultTableHeader() definition code for javax.swing.JTable.createDefaultTableHeader()

protected JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader  createDefaultTableHeader()
Returns the default table header object, which is a JTableHeader. A subclass can override this method to return a different table header object.

Returns:
the default table header object
See Also:
JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader

resizeAndRepaint sample code for javax.swing.JTable.resizeAndRepaint() definition code for javax.swing.JTable.resizeAndRepaint()

protected void resizeAndRepaint()
Equivalent to revalidate followed by repaint.


getCellEditor sample code for javax.swing.JTable.getCellEditor() definition code for javax.swing.JTable.getCellEditor()

public TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  getCellEditor()
Returns the cell editor.

Returns:
the TableCellEditor that does the editing
See Also:
cellEditor sample code for javax.swing.JTable.cellEditor definition code for javax.swing.JTable.cellEditor

setCellEditor sample code for javax.swing.JTable.setCellEditor(javax.swing.table.TableCellEditor) definition code for javax.swing.JTable.setCellEditor(javax.swing.table.TableCellEditor)

public void setCellEditor(TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  anEditor)
Sets the cellEditor variable.

Parameters:
anEditor - the TableCellEditor that does the editing
See Also:
cellEditor sample code for javax.swing.JTable.cellEditor definition code for javax.swing.JTable.cellEditor

setEditingColumn sample code for javax.swing.JTable.setEditingColumn(int) definition code for javax.swing.JTable.setEditingColumn(int)

public void setEditingColumn(int aColumn)
Sets the editingColumn variable.

Parameters:
aColumn - the column of the cell to be edited
See Also:
editingColumn sample code for javax.swing.JTable.editingColumn definition code for javax.swing.JTable.editingColumn

setEditingRow sample code for javax.swing.JTable.setEditingRow(int) definition code for javax.swing.JTable.setEditingRow(int)

public void setEditingRow(int aRow)
Sets the editingRow variable.

Parameters:
aRow - the row of the cell to be edited
See Also:
editingRow sample code for javax.swing.JTable.editingRow definition code for javax.swing.JTable.editingRow

getCellRenderer sample code for javax.swing.JTable.getCellRenderer(int, int) definition code for javax.swing.JTable.getCellRenderer(int, int)

public TableCellRenderer sample code for javax.swing.table.TableCellRenderer definition code for javax.swing.table.TableCellRenderer  getCellRenderer(int row,
                                         int column)
Returns an appropriate renderer for the cell specified by this row and column. If the TableColumn for this column has a non-null renderer, returns that. If not, finds the class of the data in this column (using getColumnClass) and returns the default renderer for this type of data.

Note: Throughout the table package, the internal implementations always use this method to provide renderers so that this default behavior can be safely overridden by a subclass.

Parameters:
row - the row of the cell to render, where 0 is the first row
column - the column of the cell to render, where 0 is the first column
Returns:
the assigned renderer; if null returns the default renderer for this type of object
See Also:
DefaultTableCellRenderer sample code for javax.swing.table.DefaultTableCellRenderer definition code for javax.swing.table.DefaultTableCellRenderer , TableColumn.setCellRenderer(javax.swing.table.TableCellRenderer) sample code for javax.swing.table.TableColumn.setCellRenderer(javax.swing.table.TableCellRenderer) definition code for javax.swing.table.TableColumn.setCellRenderer(javax.swing.table.TableCellRenderer) , setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer) sample code for javax.swing.JTable.setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer) definition code for javax.swing.JTable.setDefaultRenderer(java.lang.Class, javax.swing.table.TableCellRenderer)

prepareRenderer sample code for javax.swing.JTable.prepareRenderer(javax.swing.table.TableCellRenderer, int, int) definition code for javax.swing.JTable.prepareRenderer(javax.swing.table.TableCellRenderer, int, int)

public Component sample code for java.awt.Component definition code for java.awt.Component  prepareRenderer(TableCellRenderer sample code for javax.swing.table.TableCellRenderer definition code for javax.swing.table.TableCellRenderer  renderer,
                                 int row,
                                 int column)
Prepares the renderer by querying the data model for the value and selection state of the cell at row, column. Returns the component (may be a Component or a JComponent) under the event location.

Note: Throughout the table package, the internal implementations always use this method to prepare renderers so that this default behavior can be safely overridden by a subclass.

Parameters:
renderer - the TableCellRenderer to prepare
row - the row of the cell to render, where 0 is the first row
column - the column of the cell to render, where 0 is the first column
Returns:
the Component under the event location

getCellEditor sample code for javax.swing.JTable.getCellEditor(int, int) definition code for javax.swing.JTable.getCellEditor(int, int)

public TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  getCellEditor(int row,
                                     int column)
Returns an appropriate editor for the cell specified by row and column. If the TableColumn for this column has a non-null editor, returns that. If not, finds the class of the data in this column (using getColumnClass) and returns the default editor for this type of data.

Note: Throughout the table package, the internal implementations always use this method to provide editors so that this default behavior can be safely overridden by a subclass.

Parameters:
row - the row of the cell to edit, where 0 is the first row
column - the column of the cell to edit, where 0 is the first column
Returns:
the editor for this cell; if null return the default editor for this type of cell
See Also:
DefaultCellEditor sample code for javax.swing.DefaultCellEditor definition code for javax.swing.DefaultCellEditor

prepareEditor sample code for javax.swing.JTable.prepareEditor(javax.swing.table.TableCellEditor, int, int) definition code for javax.swing.JTable.prepareEditor(javax.swing.table.TableCellEditor, int, int)

public Component sample code for java.awt.Component definition code for java.awt.Component  prepareEditor(TableCellEditor sample code for javax.swing.table.TableCellEditor definition code for javax.swing.table.TableCellEditor  editor,
                               int row,
                               int column)
Prepares the editor by querying the data model for the value and selection state of the cell at row, column.

Note: Throughout the table package, the internal implementations always use this method to prepare editors so that this default behavior can be safely overridden by a subclass.

Parameters:
editor - the TableCellEditor to set up
row - the row of the cell to edit, where 0 is the first row
column - the column of the cell to edit, where 0 is the first column
Returns:
the Component being edited

removeEditor sample code for javax.swing.JTable.removeEditor() definition code for javax.swing.JTable.removeEditor()

public void removeEditor()
Discards the editor object and frees the real estate it used for cell rendering.


paramString sample code for javax.swing.JTable.paramString() definition code for javax.swing.JTable.paramString()

protected String sample code for java.lang.String definition code for java.lang.String  paramString()
Returns a string representation of this table. 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 be null.

Overrides:
paramString sample code for javax.swing.JComponent.paramString() definition code for javax.swing.JComponent.paramString() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
a string representation of this table

print sample code for javax.swing.JTable.print() definition code for javax.swing.JTable.print()

public boolean print()
              throws PrinterException sample code for java.awt.print.PrinterException definition code for java.awt.print.PrinterException 
A convenience method that displays a printing dialog, and then prints this JTable in mode PrintMode.FIT_WIDTH, with no header or footer text. A modal progress dialog, with an abort option, will be shown for the duration of printing.

Note: In headless mode, no dialogs will be shown.

Returns:
true, unless printing is cancelled by the user
Throws:
PrinterException sample code for java.awt.print.PrinterException definition code for java.awt.print.PrinterException - if an error in the print system causes the job to be aborted
Since:
1.5
See Also:
print(JTable.PrintMode, MessageFormat, MessageFormat, boolean, PrintRequestAttributeSet, boolean) sample code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) definition code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) , 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)

print sample code for javax.swing.JTable.print(javax.swing.JTable.PrintMode) definition code for javax.swing.JTable.print(javax.swing.JTable.PrintMode)

public boolean print(JTable.PrintMode sample code for javax.swing.JTable.PrintMode definition code for javax.swing.JTable.PrintMode  printMode)
              throws PrinterException sample code for java.awt.print.PrinterException definition code for java.awt.print.PrinterException 
A convenience method that displays a printing dialog, and then prints this JTable in the given printing mode, with no header or footer text. A modal progress dialog, with an abort option, will be shown for the duration of printing.

Note: In headless mode, no dialogs will be shown.

Parameters:
printMode - the printing mode that the printable should use
Returns:
true, unless printing is cancelled by the user
Throws:
PrinterException sample code for java.awt.print.PrinterException definition code for java.awt.print.PrinterException - if an error in the print system causes the job to be aborted
Since:
1.5
See Also:
print(JTable.PrintMode, MessageFormat, MessageFormat, boolean, PrintRequestAttributeSet, boolean) sample code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) definition code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) , 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)

print sample code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat) definition code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat)

public boolean print(JTable.PrintMode sample code for javax.swing.JTable.PrintMode definition code for javax.swing.JTable.PrintMode  printMode,
                     MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  headerFormat,
                     MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  footerFormat)
              throws PrinterException sample code for java.awt.print.PrinterException definition code for java.awt.print.PrinterException 
A convenience method that displays a printing dialog, and then prints this JTable in the given printing mode, with the specified header and footer text. A modal progress dialog, with an abort option, will be shown for the duration of printing.

Note: In headless mode, no dialogs will be shown.

Parameters:
printMode - the printing mode that the printable should use
headerFormat - a MessageFormat specifying the text to be used in printing a header, or null for none
footerFormat - a MessageFormat specifying the text to be used in printing a footer, or null for none
Returns:
true, unless printing is cancelled by the user
Throws:
PrinterException sample code for java.awt.print.PrinterException definition code for java.awt.print.PrinterException - if an error in the print system causes the job to be aborted
Since:
1.5
See Also:
print(JTable.PrintMode, MessageFormat, MessageFormat, boolean, PrintRequestAttributeSet, boolean) sample code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) definition code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) , 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)

print sample code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) definition code for javax.swing.JTable.print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean)

public boolean print(JTable.PrintMode sample code for javax.swing.JTable.PrintMode definition code for javax.swing.JTable.PrintMode  printMode,
                     MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  headerFormat,
                     MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  footerFormat,
                     boolean showPrintDialog,
                     PrintRequestAttributeSet sample code for javax.print.attribute.PrintRequestAttributeSet definition code for javax.print.attribute.PrintRequestAttributeSet  attr,
                     boolean interactive)
              throws PrinterException sample code for java.awt.print.PrinterException definition code for java.awt.print.PrinterException ,
                     HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Print this JTable. Takes steps that the majority of developers would take in order to print a JTable. In short, it prepares the table, calls getPrintable to fetch an appropriate Printable, and then sends it to the printer.

A boolean parameter allows you to specify whether or not a printing dialog is displayed to the user. When it is, the user may use the dialog to change printing attributes or even cancel the print. Another parameter allows for printing attributes to be specified directly. This can be used either to provide the initial values for the print dialog, or to supply any needed attributes when the dialog is not shown.

A second boolean parameter allows you to specify whether or not to perform printing in an interactive mode. If true, a modal progress dialog, with an abort option, is displayed for the duration of printing . This dialog also prevents any user action which may affect the table. However, it can not prevent the table from being modified by code (for example, another thread that posts updates using SwingUtilities.invokeLater). It is therefore the responsibility of the developer to ensure that no other code modifies the table in any way during printing (invalid modifications include changes in: size, renderers, or underlying data). Printing behavior is undefined when the table is changed during printing.

If false is specified for this parameter, no dialog will be displayed and printing will begin immediately on the event-dispatch thread. This blocks any other events, including repaints, from being processed until printing is complete. Although this effectively prevents the table from being changed, it doesn't provide a good user experience. For this reason, specifying false is only recommended when printing from an application with no visible GUI.

Note: Attempting to show the printing dialog or run interactively, while in headless mode, will result in a HeadlessException.

Before fetching the printable, this method prepares the table in order to get the most desirable printed result. If the table is currently in an editing mode, it terminates the editing as gracefully as possible. It also ensures that the the table's current selection and focused cell are not indicated in the printed output. This is handled on the view level, and only for the duration of the printing, thus no notification needs to be sent to the selection models.

See 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) for further description on how the table is printed.

Parameters:
printMode - the printing mode that the printable should use
headerFormat - a MessageFormat specifying the text to be used in printing a header, or null for none
footerFormat - a MessageFormat specifying the text to be used in printing a footer, or null for none
showPrintDialog - whether or not to display a print dialog
attr - a PrintRequestAttributeSet specifying any printing attributes, or null for none
interactive - whether or not to print in an interactive mode
Returns:
true, unless printing is cancelled by the user
Throws:
PrinterException sample code for java.awt.print.PrinterException definition code for java.awt.print.PrinterException - if an error in the print system causes the job to be aborted
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if the method is asked to show a printing dialog or run interactively, and GraphicsEnvironment.isHeadless returns true
Since:
1.5
See Also:
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) , GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

getPrintable 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)

public Printable sample code for java.awt.print.Printable definition code for java.awt.print.Printable  getPrintable(JTable.PrintMode sample code for javax.swing.JTable.PrintMode definition code for javax.swing.JTable.PrintMode  printMode,
                              MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  headerFormat,
                              MessageFormat sample code for java.text.MessageFormat definition code for java.text.MessageFormat  footerFormat)
Return a Printable for use in printing this JTable.

The Printable can be requested in one of two printing modes. In both modes, it spreads table rows naturally in sequence across multiple pages, fitting as many rows as possible per page. PrintMode.NORMAL specifies that the table be printed at its current size. In this mode, there may be a need to spread columns across pages in a similar manner to that of the rows. When the need arises, columns are distributed in an order consistent with the table's ComponentOrientation. PrintMode.FIT_WIDTH specifies that the output be scaled smaller, if necessary, to fit the table's entire width (and thereby all columns) on each page. Width and height are scaled equally, maintaining the aspect ratio of the output.

The Printable heads the portion of table on each page with the appropriate section from the table's JTableHeader, if it has one.

Header and footer text can be added to the output by providing MessageFormat arguments. The printing code requests Strings from the formats, providing a single item which may be included in the formatted string: an Integer representing the current page number.

You are encouraged to read the documentation for MessageFormat as some characters, such as single-quote, are special and need to be escaped.

Here's an example of creating a MessageFormat that can be used to print "Duke's Table: Page - " and the current page number:

     // notice the escaping of the single quote
     // notice how the page number is included with "{0}"
     MessageFormat format = new MessageFormat("Duke''s Table: Page - {0}");
 

The Printable constrains what it draws to the printable area of each page that it prints. Under certain circumstances, it may find it impossible to fit all of a page's content into that area. In these cases the output may be clipped, but the implementation makes an effort to do something reasonable. Here are a few situations where this is known to occur, and how they may be handled by this particular implementation:

It is entirely valid for this Printable to be wrapped inside another in order to create complex reports and documents. You may even request that different pages be rendered into different sized printable areas. The implementation must be prepared to handle this (possibly by doing its layout calculations on the fly). However, providing different heights to each page will likely not work well with PrintMode.NORMAL when it has to spread columns across pages.

It is important to note that this Printable prints the table at its current visual state, using the table's existing renderers. Before calling this method, you may wish to first modify the state of the table (such as to change the renderers, cancel editing, or hide the selection).

You must not, however, modify the table in any way after this Printable is fetched (invalid modifications include changes in: size, renderers, or underlying data). The behavior of the returned Printable is undefined once the table has been changed.

Here's a simple example that calls this method to fetch a Printable, shows a cross-platform print dialog, and then prints the Printable unless the user cancels the dialog:

     // prepare the table for printing here first (for example, hide selection)

     // wrap in a try/finally so table can be restored even if something fails
     try {
         // fetch the printable
         Printable printable = table.getPrintable(JTable.PrintMode.FIT_WIDTH,
                                                  new MessageFormat("My Table"),
                                                  new MessageFormat("Page - {0}"));

         // fetch a PrinterJob
         PrinterJob job = PrinterJob.getPrinterJob();

         // set the Printable on the PrinterJob
         job.setPrintable(printable);

         // create an attribute set to store attributes from the print dialog
         PrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();

         // display a print dialog and record whether or not the user cancels it
         boolean printAccepted = job.printDialog(attr);

         // if the user didn't cancel the dialog
         if (printAccepted) {
             // do the printing (may need to handle PrinterException)
             job.print(attr);
         }
     } finally {
         // restore the original table state here (for example, restore selection)
     }
 

Parameters:
printMode - the printing mode that the printable should use
headerFormat - a MessageFormat specifying the text to be used in printing a header, or null for none
footerFormat - a MessageFormat specifying the text to be used in printing a footer, or null for none
Returns:
a Printable for printing this JTable
Since:
1.5
See Also:
Printable sample code for java.awt.print.Printable definition code for java.awt.print.Printable , PrinterJob sample code for java.awt.print.PrinterJob definition code for java.awt.print.PrinterJob

getAccessibleContext sample code for javax.swing.JTable.getAccessibleContext() definition code for javax.swing.JTable.getAccessibleContext()

public AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext  getAccessibleContext()
Gets the AccessibleContext associated with this JTable. For tables, the AccessibleContext takes the form of an AccessibleJTable. A new AccessibleJTable instance is created if necessary.

Specified by:
getAccessibleContext sample code for javax.accessibility.Accessible.getAccessibleContext() definition code for javax.accessibility.Accessible.getAccessibleContext() in interface Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible
Overrides:
getAccessibleContext sample code for javax.swing.JComponent.getAccessibleContext() definition code for javax.swing.JComponent.getAccessibleContext() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
an AccessibleJTable that serves as the AccessibleContext of this JTable