public class DefaultTableCellRenderer extends javax.swing.JLabel implements TableCellRenderer, java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultTableCellRenderer.UIResource |
javax.swing.JLabel.AccessibleJLabeljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected static javax.swing.border.Border |
noFocusBorder |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
DefaultTableCellRenderer()
Creates a default table cell renderer with an empty border.
|
| Modifier and Type | Method and Description |
|---|---|
void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
Overriden for performance.
|
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Overriden for performance.
|
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Get the string value of the object and pass it to setText().
|
boolean |
isOpaque()
Overriden for performance.
|
void |
repaint(long tm,
int x,
int y,
int width,
int height)
Overriden for performance.
|
void |
repaint(java.awt.Rectangle r)
Overriden for performance.
|
void |
revalidate()
Queue a an invalidation and revalidation of this component, using
RepaintManager.addInvalidComponent(javax.swing.JComponent). |
void |
setBackground(java.awt.Color c)
Assign the unselected-background.
|
void |
setForeground(java.awt.Color c)
Assign the unselected-foreground.
|
protected void |
setValue(java.lang.Object value)
Sets the String for this cell.
|
void |
updateUI()
Look and feel has changed.
|
void |
validate()
Overriden for performance.
|
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setFont, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPositionaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateTreeaction, 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, getFontMetrics, 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, hide, 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, processMouseEvent, 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, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected static javax.swing.border.Border noFocusBorder
public DefaultTableCellRenderer()
public void setForeground(java.awt.Color c)
setForeground in class javax.swing.JComponentc - the color to assignComponent.getForeground()public void setBackground(java.awt.Color c)
setBackground in class javax.swing.JComponentc - the color to assignComponent.getBackground()public void updateUI()
Replaces the current UI object with the latest version from the UIManager.
updateUI in class javax.swing.JLabelpublic java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent in interface TableCellRenderertable - the JTablevalue - the value of the object. For the text content,
null is rendered as an empty cell.isSelected - is the cell selected?hasFocus - has the cell the focus?row - the row to rendercolumn - the cell to renderpublic boolean isOpaque()
This method needs to be overridden in a subclass to actually do something.
isOpaque in class javax.swing.JComponentComponent.isLightweight()public void validate()
This method needs to be overridden in a subclass to actually do something.
validate in class java.awt.ContainerComponent.invalidate(),
Component.doLayout(),
LayoutManager,
Container.validate()public void revalidate()
javax.swing.JComponentRepaintManager.addInvalidComponent(javax.swing.JComponent).revalidate in class javax.swing.JComponentpublic void repaint(long tm, int x, int y, int width, int height)
This method needs to be overridden in a subclass to actually do something.
repaint in class javax.swing.JComponenttm - ignoredx - coordinate of the region to mark as dirtyy - coordinate of the region to mark as dirtywidth - dimension of the region to mark as dirtyheight - dimension of the region to mark as dirtyComponent.update(Graphics)public void repaint(java.awt.Rectangle r)
This method needs to be overridden in a subclass to actually do something.
repaint in class javax.swing.JComponentr - The rectangle to mark as dirtyprotected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
This method needs to be overridden in a subclass to actually do something.
firePropertyChange in class java.awt.ComponentpropertyName - the property that changedoldValue - the old property valuenewValue - the new property valuepublic void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
This method needs to be overridden in a subclass to actually do something.
firePropertyChange in class javax.swing.JComponentpropertyName - the name of the propertyoldValue - the old value of the propertynewValue - the new value of the propertyprotected void setValue(java.lang.Object value)
value - the string value for this cell; if value is null it
sets the text value to an empty string