Results 1 to 1 of 1

Thread: deleting rows from a JTable{Problem solved}

Threaded View

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Resolved deleting rows from a JTable{Problem solved}

    I know that you can call this method to delete a row from a JTable:
    Code:
    DefaultTableModel.deleteRow(index);

    I need to delete all of the rows at some point, and this is not working:
    Code:
    for (int i=0; i<dtm.getRowCount(); i++) 
    { 
           dtm.removeRow(i); mortgageTable.revalidate(); 
    }

    I tried revalidating, but that didn't work. This only deletes the last row. Now, at runtime the table consists of only one row and later many rows are added. So I'm thinking the DefaultTableModel is not picking up the newly added rows.
    Last edited by System_Error; Jun 20th, 2005 at 09:24 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width