N
news.rcn.com
I have a JTable whose cells display values derived from the data in the
TableModel (rather than the the data itself.)
When a cell is selected (by mouse or keyboard navigation) I need to
1) show the raw data from the table model (not the derived data)
2) highlight it to show it will be replaced after editing.
This needs to be done before the user types into the cell.
I can't figure out how to catch an event when a table cell is selected. My
best guess is to is overide the 'isCellEditable' in the table model and try
to get the cell renderer, then get the Component that draws it.
and load the raw data and select it. However, I could not get this to work.
Alternatively, if I could the cell editor directly when the table cell gets
selected, I could load the raw data in there and let the user have her way
with it. Can I do this? It seems that nobody cares about the editor until
the table cell gets a keystroke typed into it; then the editor UI takes over
the table cell real estate (from the renderer).
I'd appreciate any help or suggestions. Thanks in advance.
jim cant
(e-mail address removed)
TableModel (rather than the the data itself.)
When a cell is selected (by mouse or keyboard navigation) I need to
1) show the raw data from the table model (not the derived data)
2) highlight it to show it will be replaced after editing.
This needs to be done before the user types into the cell.
I can't figure out how to catch an event when a table cell is selected. My
best guess is to is overide the 'isCellEditable' in the table model and try
to get the cell renderer, then get the Component that draws it.
and load the raw data and select it. However, I could not get this to work.
Alternatively, if I could the cell editor directly when the table cell gets
selected, I could load the raw data in there and let the user have her way
with it. Can I do this? It seems that nobody cares about the editor until
the table cell gets a keystroke typed into it; then the editor UI takes over
the table cell real estate (from the renderer).
I'd appreciate any help or suggestions. Thanks in advance.
jim cant
(e-mail address removed)