Hi, I have a JTable with 2 columns(say). I need to add a third column which should display the row number in it. How do i display the row number .Is there any API to get the row number of a JTable? When i remove a row from JTable the row numbers should automatically update. How should i do? Pls suggest. Thanks, Raj
You need to write your TableModel class. If your currently using DefaultTableModel or not specifiy a table model ( DefaultTableModel is used by default.) then you can do something like this :