I have a JTable with multiple columns line
let's say : name, cat, subcat, lang
I would like a cell editor on name ;cat , subcat and lang read only
when I edit name whenever I choose a mame that belongs to
cat,subcat,lang the cat,subcat,lang cells are updated .....
tanks a lot
patrick
jdk1.6.0_02/linux
bcr666 - 22 Jun 2007 16:59 GMT
> I have a JTable with multiple columns line
> let's say : name, cat, subcat, lang
[quoted text clipped - 4 lines]
> patrick
> jdk1.6.0_02/linux
For a situation like this I would probably use a subclass of
DefaultTableModel as the model for the table. It is a simple matter
of overriding the isCellEditable() method to only allow editing on
column "name".
You should be able to register a listener to the model to detect when
a cell value changes. If the cell is in the name column,
programmatically change the values in the other cells by calling
setValueAt().
root - 22 Jun 2007 20:29 GMT
>> I have a JTable with multiple columns line
>> let's say : name, cat, subcat, lang
[quoted text clipped - 13 lines]
> programmatically change the values in the other cells by calling
> setValueAt().
thank you
I will investigate in these listeners
patrick