Re: CustomRenderer for enum
- From: Ray Ma <Wenj.Ma@xxxxxxxxx>
- Date: Wed, 15 Aug 2007 21:15:03 -0000
Usually, when I'm trying to define a customized component in a Jtable
cell I'll extends the TableCellEditor instead of the
TableCellRenderer. Because when you click on a cell, the system will
use the cellEditor instead of cellRender to handle the content of that
cell. So that might be the reason you can't see correct value in your
cell. Let the renderer do no more than color and look&feel management.
You can google for examples that put a Button in the table cell.
use:
MyCellEditor extends JComboBox implements TableCellEditor{
public Component getTableCellEditorComponent(JTable table, Object
value,
boolean isSelected,
int row, int column)
{
...
return this;
}
}
.
- Follow-Ups:
- Re: CustomRenderer for enum
- From: malpropio
- Re: CustomRenderer for enum
- References:
- CustomRenderer for enum
- From: malpropio
- CustomRenderer for enum
- Prev by Date: where to use setAutoCreateRowSorter(false) in JTable
- Next by Date: JColourChooser
- Previous by thread: CustomRenderer for enum
- Next by thread: Re: CustomRenderer for enum
- Index(es):