Package smile.swing
Class Table
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
org.jdesktop.swingx.JXTable
smile.swing.Table
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,CellEditorListener
,ListSelectionListener
,RowSorterListener
,TableColumnModelListener
,TableModelListener
,Scrollable
,org.jdesktop.swingx.event.TableColumnModelExtListener
public class Table
extends org.jdesktop.swingx.JXTable
Customized JTable with optional row number header. It also provides the
renderer and editor Color and Font. It also provides a renderer for
Float/Double of special values (such as NaN and Infinity).
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Use a JTable as a renderer for row numbers of the main table.Nested classes/interfaces inherited from class org.jdesktop.swingx.JXTable
org.jdesktop.swingx.JXTable.BooleanEditor, org.jdesktop.swingx.JXTable.GenericEditor, org.jdesktop.swingx.JXTable.NumberEditor, org.jdesktop.swingx.JXTable.TableAdapter
Nested classes/interfaces inherited from class javax.swing.JTable
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class org.jdesktop.swingx.JXTable
compoundHighlighter, dataAdapter, editorRemover, filteredRowCountChanged, FOCUS_NEXT_COMPONENT, FOCUS_PREVIOUS_COMPONENT, forceRevalidate, HORIZONTALSCROLL_ACTION_COMMAND, isXTableRowHeightSet, MATCH_HIGHLIGHTER, PACKALL_ACTION_COMMAND, PACKSELECTED_ACTION_COMMAND, resetDefaultTableCellRendererHighlighter, searchable, UIPREFIX, USE_DTCR_COLORMEMORY_HACK
Fields inherited from class javax.swing.JTable
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
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
ConstructorDescriptionTable()
Constructs a default JTable that is initialized with a default data model, a default column model, and a default selection model.Table
(int numRows, int numColumns) Constructs a JTable with numRows and numColumns of empty cells using DefaultTableModel.Constructs a JTable to display the values in the two-dimensional array, rowData, with column names, columnNames.Table
(TableModel dm) Constructs a JTable that is initialized with dm as the data model, a default column model, and a default selection model.Table
(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.Table
(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 -
Method Summary
Modifier and TypeMethodDescriptiongetCellEditor
(int row, int column) getCellRenderer
(int row, int column) Returns a row header for this table.boolean
Methods inherited from class org.jdesktop.swingx.JXTable
addHighlighter, adjustComponentOrientation, adminSetRowHeight, columnAdded, columnMarginChanged, columnPropertyChange, columnSelectionChanged, configureColumnControl, configureEnclosingScrollPane, configureSorterProperties, createDefaultColumnControl, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultEditors, createDefaultRenderers, createDefaultRowSorter, createDefaultStringValueRegistry, createDefaultTableHeader, createHighlighterChangeListener, createLinkController, createRolloverProducer, doFind, doLayout, editCellAt, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getColumn, getColumnControl, getColumnCount, getColumnExt, getColumnExt, getColumnFactory, getColumnMargin, getColumns, getColumns, getComponentAdapter, getComponentAdapter, getCompoundHighlighter, getControlsSorterProperties, getHighlighterChangeListener, getHighlighters, getLinkController, getNewDefaultRenderer, getPreferredScrollableViewportSize, getRowFilter, getSearchable, getSelectionMode, getSortController, getSortedColumn, getSortOrder, getSortOrder, getSortOrderCycle, getSortsOnUpdates, getStringAt, getStringValueRegistry, getUIString, getUIString, getVisibleColumnCount, getVisibleRowCount, hasSortController, initializeColumnPreferredWidth, initializeColumnWidths, isAutoStartEditOnKeyStroke, isCellEditable, isColumnControlVisible, isDataChanged, isEditable, isFocusCycleRoot, isHorizontalScrollEnabled, isRolloverEnabled, isRowHeightEnabled, isSortable, isSortable, isSortable, isStructureChanged, isTerminateEditOnFocusLost, isUpdate, packAll, packColumn, packColumn, packSelected, packTable, postprocessModelChange, postprocessSorterChanged, prepareEditor, prepareRenderer, preprocessModelChange, removeEditor, removeHighlighter, removeNotify, resetDefaultTableCellRendererColors, resetSortOrder, rowAtPoint, scrollCellToVisible, scrollColumnToVisible, scrollRowToVisible, setAutoCreateRowSorter, setAutoResizeMode, setAutoStartEditOnKeyStroke, setColumnControl, setColumnControlVisible, setColumnFactory, setColumnMargin, setColumnModel, setColumnSequence, setComponentOrientation, setDefaultRenderer, setEditable, setFillsViewportHeight, setGridColor, setHighlighters, setHorizontalScrollEnabled, setLocale, setModel, setPreferredScrollableViewportSize, setRolloverEnabled, setRowFilter, setRowHeight, setRowHeightEnabled, setRowSorter, setSearchable, setSelectionBackground, setSelectionForeground, setShowGrid, setShowGrid, setSortable, setSortOrder, setSortOrder, setSortOrderCycle, setSortsOnUpdates, setTerminateEditOnFocusLost, setValueAt, setVisibleColumnCount, setVisibleRowCount, sorterChanged, tableChanged, toggleSortOrder, toggleSortOrder, transferFocus, transferFocusBackward, unconfigureColumnControl, unconfigureEnclosingScrollPane, updateColumnControlUI, updateColumnUI, updateHighlighterUI, updateHorizontalAction, updateLocaleActionState, updateLocaleState, updateRowHeightUI, updateUI
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAtPoint, columnMoved, columnRemoved, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultDataModel, createDefaultSelectionModel, createScrollPaneForTable, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoResizeMode, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeRowSelectionInterval, resizeAndRepaint, selectAll, setAutoCreateColumnsFromModel, setCellEditor, setCellSelectionEnabled, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setIntercellSpacing, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionMode, setSelectionModel, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, sizeColumnsToFit, sizeColumnsToFit, valueChanged
Methods inherited from class javax.swing.JComponent
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
Methods inherited from class java.awt.Container
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, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.swing.event.TableColumnModelListener
columnMoved, columnRemoved
-
Constructor Details
-
Table
public Table()Constructs a default JTable that is initialized with a default data model, a default column model, and a default selection model. -
Table
public Table(int numRows, int numColumns) Constructs a JTable with numRows and numColumns of empty cells using DefaultTableModel.- Parameters:
numRows
- the number of rows the table holds.numColumns
- the number of columns the table holds.
-
Table
Constructs a JTable to display the values in the two-dimensional array, rowData, with column names, columnNames.- Parameters:
rowData
- the data for the new table.columnNames
- the names of each column.
-
Table
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
-
Table
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.
-
Table
Constructs a JTable that is initialized with dm as the data model, cm as the column model, and sm as the selection model- Parameters:
dm
- the data model for the table.cm
- the column model for the table.sm
- the row selection model for the table.
-
-
Method Details
-
getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth()- Specified by:
getScrollableTracksViewportWidth
in interfaceScrollable
- Overrides:
getScrollableTracksViewportWidth
in classorg.jdesktop.swingx.JXTable
-
getCellRenderer
- Overrides:
getCellRenderer
in classorg.jdesktop.swingx.JXTable
-
getCellEditor
- Overrides:
getCellEditor
in classJTable
-
getRowHeader
Returns a row header for this table. The row header must be added to the row header of the JScrollPane that contains this table.- Returns:
- the row header component.
-