Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to delete a row from JTable ?

843806May 16 2007 — edited May 17 2007
Hi,

I want to delete a row from JTable. I am using DefaultTableModel class.
Problem is : every time when i try to delete the row, it is deleting final/last row. before deleting the row i am printing the 'row' value, it's displaying the correct row number, i.e., which i selected.

I am totally confused how it is deleting the last row.

my snippet :
tablemodel.removeRow(row);

please suggest where i am going wrong or snippets in this regard.

Regards,
Ravi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 14 2007
Added on May 16 2007
10 comments
268 views