Extending JTable through codes, adding objects into the cell
Posted on 2006-03-27
I need to write a piece of code that add row of information into a table whenever the user click button "Add person" after entering some information. E.g. User enters name, id of a person, and when click, name, id of the person gets entered into Column A and Column B in a new row.
In Column C, I then need to programatically add a checkbox for the user. When the user click on the checkbox, the whole cell will turn green, and if the checkbox is unclicked, the whole cell will turn red.
If user click on "Add Device", then the columns in the table will added by one, and all the rows in the table will get a new cell, with a checkbox added into it.
I'm not familiar with Swing, AWT. Can someone help me with how to write this code?