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:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.CellEditorListener, javax.swing.event.ListSelectionListener, javax.swing.event.RowSorterListener, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener, javax.swing.Scrollable, TableColumnModelExtListener
public class Table extends 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classTable.RowHeaderUse a JTable as a renderer for row numbers of the main table.-
Nested classes/interfaces inherited from class org.jdesktop.swingx.JXTable
JXTable.BooleanEditor, JXTable.GenericEditor, JXTable.NumberEditor
-
Nested classes/interfaces inherited from class javax.swing.JTable
javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode
-
-
Field Summary
-
Fields inherited from class org.jdesktop.swingx.JXTable
FOCUS_NEXT_COMPONENT, FOCUS_PREVIOUS_COMPONENT, HORIZONTALSCROLL_ACTION_COMMAND, MATCH_HIGHLIGHTER, PACKALL_ACTION_COMMAND, PACKSELECTED_ACTION_COMMAND, 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
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor and Description Table()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.Table(java.lang.Object[][] rowData, java.lang.Object[] columnNames)Constructs a JTable to display the values in the two dimensional array, rowData, with column names, columnNames.Table(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.Table(javax.swing.table.TableModel dm, 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.Table(javax.swing.table.TableModel dm, javax.swing.table.TableColumnModel cm, 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
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description javax.swing.table.TableCellEditorgetCellEditor(int row, int column)javax.swing.table.TableCellRenderergetCellRenderer(int row, int column)javax.swing.JTablegetRowHeader()Returns a row header for this table.booleangetScrollableTracksViewportWidth()-
Methods inherited from class org.jdesktop.swingx.JXTable
addHighlighter, columnAdded, columnMarginChanged, columnPropertyChange, columnSelectionChanged, createDefaultColumnsFromModel, doLayout, editCellAt, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getColumn, getColumn, getColumnControl, getColumnCount, getColumnExt, getColumnExt, getColumnExt, getColumnFactory, getColumnMargin, getColumns, getColumns, getHighlighters, getPopupLocation, getPopupTriggerLocation, getPreferredScrollableViewportSize, getRowFilter, getSearchable, getSelectionMode, getSortedColumn, getSortedColumnIndex, getSortOrder, getSortOrder, getSortOrderCycle, getSortsOnUpdates, getStringAt, getVisibleColumnCount, getVisibleRowCount, isAutoStartEditOnKeyStroke, isCellEditable, isColumnControlVisible, isEditable, isFocusCycleRoot, isHorizontalScrollEnabled, isRolloverEnabled, isSortable, isTerminateEditOnFocusLost, packAll, packColumn, packColumn, packSelected, packTable, prepareEditor, prepareRenderer, prepareRenderer, removeEditor, removeHighlighter, removeNotify, 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, setRowSorter, setSearchable, setSelectionBackground, setSelectionForeground, setShowGrid, setShowGrid, setSortable, setSortOrder, setSortOrder, setSortOrderCycle, setSortsOnUpdates, setTerminateEditOnFocusLost, setValueAt, setVisibleColumnCount, setVisibleRowCount, sorterChanged, tableChanged, toggleSortOrder, toggleSortOrder, transferFocus, transferFocusBackward, updateUI
-
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAtPoint, columnMoved, columnRemoved, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, 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, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, print, print, print, print, print, removeColumn, removeColumnSelectionInterval, removeRowSelectionInterval, 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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
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
public Table(java.lang.Object[][] rowData, java.lang.Object[] columnNames)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
public Table(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
-
Table
public Table(javax.swing.table.TableModel dm, 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.
-
Table
public Table(javax.swing.table.TableModel dm, javax.swing.table.TableColumnModel cm, 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- Parameters:
dm- the data model for the table.cm- the column model for the table.sm- the row selection model for the table.
-
-
Method Detail
-
getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth()
Description copied from class:JXTableOverridden to support enhanced auto-resize behaviour enabled and necessary.
- Specified by:
getScrollableTracksViewportWidthin interfacejavax.swing.Scrollable- Overrides:
getScrollableTracksViewportWidthin classJXTable- See Also:
JXTable.setHorizontalScrollEnabled(boolean)
-
getCellRenderer
public javax.swing.table.TableCellRenderer getCellRenderer(int row, int column)Description copied from class:JXTableOverridden to fix core bug #4614616 (NPE if
TableModel'sClassfor the column is an interface). This method guarantees to always return anot nullvalue. Returns the default renderer forObjectif super returnsnull.Note: The lookup strategy for is unchanged compared to super. Subclasses which override this with a different lookup strategy are strongly advised to implement a custom StringValueRegistry with that lookup strategy to keep the WYSIWYM in SwingX.
- Overrides:
getCellRendererin classJXTable
-
getCellEditor
public javax.swing.table.TableCellEditor getCellEditor(int row, int column)- Overrides:
getCellEditorin classjavax.swing.JTable
-
getRowHeader
public javax.swing.JTable 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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG