Q: How to clear data from a JTable? I am programming at Netbeans, and I have a jTable in a frame.
In which I load data that occupies a lot of rows, but then i load another table that has a lot less rows. 
And when i am running it, and loading the 2nd table, the extra rows that the first table had are still appearing there. And i wish to just see the 2nd table.
I already tried for jTable.removeAll();

A: JTable uses the Model/View/Controller methodology, which means that the JTable class is both the View and Controller, so you need to either replace the TableModel by using JTable.setModel(newModel) or clear the TableModel by using JTable.getModel() and clearing the model that way.
See the tutorial on using tables in the JTable Tutorials.

A: The best solution for your question is
private void ClearButtonActionPerformed(java.awt.event.ActionEvent evt) {
    DefaultTableModel model = (DefaultTableModel)UR_TABLEVARIABLENAME.getModel();

    while (model.getRowCount() > 0){
        for (int i = 0; i < model.getRowCount(); ++i){
            model.removeRow(i);
        }
    }
}    

