Clear « JTable « Java Swing Q&A





1. how to clear JTable    stackoverflow.com

How can i clear the content of the JTable using Java..

2. JTable will not clear    coderanch.com

3. Clear JTable at once    coderanch.com

4. how to "clear" jTable    coderanch.com

here's what i'm trying: //how was before: // getJTablePautaTurma().clearSelection(); // getJTablePautaTurma().setModel(new DefaultTableModel()); //now: DefaultTableModel modelo = new DefaultTableModel(); modelo.setRowCount(0); String[] nomeDaColuna = {"N", "Nome", "Outro nome", "Apelido"}; // modelo.setColumnCount(4); modelo.setColumnIdentifiers(nomeDaColuna); /* Vector vector = new Vector(); modelo.addColumn("N", vector); modelo.addColumn("Nome", vector); modelo.addColumn("Outro nome", vector); modelo.addColumn("Apelido", vector);*/ getJTablePautaTurma().setModel(modelo); getJTablePautaTurma().updateUI(); // getJTablePautaTurma().repaint(); and i always get Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0 >= 0 ...

5. How can I clear the JTable    forums.oracle.com

6. Jtable not clearing value    forums.oracle.com