|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
javax.swing.table.DefaultTableCellRenderer
public class DefaultTableCellRenderer
Class to display every cells.
Nested Class Summary | |
---|---|
static class |
DefaultTableCellRenderer.UIResource
|
Nested classes/interfaces inherited from class javax.swing.JLabel |
---|
JLabel.AccessibleJLabel |
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.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected static Border |
noFocusBorder
|
Fields inherited from class javax.swing.JLabel |
---|
labelFor |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, 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 |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DefaultTableCellRenderer()
Creates a default table cell renderer with an empty border. |
Method Summary | |
---|---|
void |
firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
Overriden for performance. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Overriden for performance. |
Component |
getTableCellRendererComponent(JTable table,
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(Rectangle r)
Overriden for performance. |
void |
revalidate()
Queue a an invalidation and revalidation of this component, using RepaintManager.addInvalidComponent(javax.swing.JComponent) . |
void |
setBackground(Color c)
Assign the unselected-background. |
void |
setForeground(Color c)
Assign the unselected-foreground. |
protected void |
setValue(Object value)
Sets the String for this cell. |
void |
updateUI()
Look and feel has changed. |
void |
validate()
Overriden for performance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static Border noFocusBorder
Constructor Detail |
---|
public DefaultTableCellRenderer()
Method Detail |
---|
public void setForeground(Color c)
setForeground
in class JComponent
c
- the color to assignComponent.getForeground()
public void setBackground(Color c)
setBackground
in class JComponent
c
- the color to assignComponent.getBackground()
public void updateUI()
Replaces the current UI object with the latest version from the UIManager.
updateUI
in class JLabel
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent
in interface TableCellRenderer
table
- 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 render
public boolean isOpaque()
This method needs to be overridden in a subclass to actually do something.
isOpaque
in class JComponent
Component.isLightweight()
public void validate()
This method needs to be overridden in a subclass to actually do something.
validate
in class Container
Component.invalidate()
,
Component.doLayout()
,
LayoutManager
,
Container.validate()
public void revalidate()
JComponent
RepaintManager.addInvalidComponent(javax.swing.JComponent)
.
revalidate
in class JComponent
public 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 JComponent
tm
- 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(Rectangle r)
This method needs to be overridden in a subclass to actually do something.
repaint
in class JComponent
r
- The rectangle to mark as dirtyprotected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
This method needs to be overridden in a subclass to actually do something.
firePropertyChange
in class Component
propertyName
- the property that changedoldValue
- the old property valuenewValue
- the new property valuepublic void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
This method needs to be overridden in a subclass to actually do something.
firePropertyChange
in class JComponent
propertyName
- the name of the propertyoldValue
- the old value of the propertynewValue
- the new value of the propertyprotected void setValue(Object value)
value
- the string value for this cell; if value is null it
sets the text value to an empty string
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |