public class JXTable extends JTable
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JXTable()
Constructs a default
JTable that is initialized with a default
data model, a default column model, and a default selection
model. |
JXTable(int numRows,
int numColumns)
Constructs a
JTable with numRows
and numColumns of empty cells using
DefaultTableModel . |
JXTable(Object[][] rowData,
Object[] columnNames)
Constructs a
JTable to display the values in the two dimensional array,
rowData , with column names, columnNames . |
JXTable(TableModel dm)
Constructs a
JTable that is initialized with
dm as the data model, a default column model,
and a default selection model. |
JXTable(TableModel dm,
TableColumnModel cm)
Constructs a
JTable that is initialized with
dm as the data model, cm
as the column model, and a default selection model. |
JXTable(TableModel dm,
TableColumnModel cm,
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. |
JXTable(Vector rowData,
Vector columnNames)
Constructs a
JTable to display the values in the
Vector of Vectors , rowData ,
with column names, columnNames . |
Modifier and Type | Method and Description |
---|---|
protected void |
configureEnclosingScrollPane() |
TableCellEditor |
getDefaultEditor(Class columnClass)
Returns the editor to be used when no editor has been set in
a
TableColumn . |
TableCellRenderer |
getDefaultRenderer(Class columnClass)
Returns the cell renderer to be used when no renderer has been set in
a
TableColumn . |
TableRowHeaderController |
getTableRowHeaderController() |
void |
reinit() |
void |
setTableRowHeaderController(TableRowHeaderController tableRowHeaderFactory) |
protected void |
unconfigureEnclosingScrollPane() |
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, updateUI, valueChanged
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public JXTable()
JTable
that is initialized with a default
data model, a default column model, and a default selection
model.public JXTable(TableModel dm)
JTable
that is initialized with
dm
as the data model, a default column model,
and a default selection model.dm
- the data model for the tableJTable.createDefaultColumnModel()
,
JTable.createDefaultSelectionModel()
public JXTable(TableModel dm, TableColumnModel cm)
JTable
that is initialized with
dm
as the data model, cm
as the column model, and a default selection model.dm
- the data model for the tablecm
- the column model for the tableJTable.createDefaultSelectionModel()
public JXTable(TableModel dm, TableColumnModel cm, ListSelectionModel sm)
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
.dm
- the data model for the tablecm
- the column model for the tablesm
- the row selection model for the tableJTable.createDefaultDataModel()
,
JTable.createDefaultColumnModel()
,
JTable.createDefaultSelectionModel()
public JXTable(int numRows, int numColumns)
JTable
with numRows
and numColumns
of empty cells using
DefaultTableModel
. The columns will have
names of the form "A", "B", "C", etc.numRows
- the number of rows the table holdsnumColumns
- the number of columns the table holdsDefaultTableModel
public JXTable(Vector rowData, Vector columnNames)
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);
rowData
- the data for the new tablecolumnNames
- names of each columnpublic JXTable(Object[][] rowData, Object[] columnNames)
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
.
rowData
- the data for the new tablecolumnNames
- names of each columnpublic void reinit()
public TableCellEditor getDefaultEditor(Class columnClass)
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.getDefaultEditor
in class JTable
columnClass
- return the default cell editor for this columnClassJTable.setDefaultEditor(java.lang.Class<?>, javax.swing.table.TableCellEditor)
,
JTable.getColumnClass(int)
public TableCellRenderer getDefaultRenderer(Class columnClass)
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.getDefaultRenderer
in class JTable
columnClass
- return the default cell renderer
for this columnClassJTable.setDefaultRenderer(java.lang.Class<?>, javax.swing.table.TableCellRenderer)
,
JTable.getColumnClass(int)
protected void configureEnclosingScrollPane()
configureEnclosingScrollPane
in class JTable
protected void unconfigureEnclosingScrollPane()
unconfigureEnclosingScrollPane
in class JTable
public TableRowHeaderController getTableRowHeaderController()
public void setTableRowHeaderController(TableRowHeaderController tableRowHeaderFactory)
Copyright © 2002–2016 SoftSmithy. All rights reserved.