How can I clear the JTable

How can I make to clear all data inside JTable?
[54 byte] By [dreampeppers99a] at [2007-10-3 8:26:23]
# 1
you have to get it's TableModel and then set the table model's value[][] object to new String[]{}; that is, if your table uses strings.Use the API to figure out the code. JTables are evil
mkoryaka at 2007-7-15 3:32:46 > top of Java-index,Java Essentials,New To Java...
# 2
I agree with mkoryak with one exception:> JTables are evilevil is a little harse. They just aren't as simple as they look.
zadoka at 2007-7-15 3:32:46 > top of Java-index,Java Essentials,New To Java...
# 3
also this might work:table.setModel(new DefaultTableModel(0, 0));
mkoryaka at 2007-7-15 3:32:46 > top of Java-index,Java Essentials,New To Java...
# 4
There are a few ways to clear out a JTable.JTables are one of the most versatile Components.
filestreama at 2007-7-15 3:32:46 > top of Java-index,Java Essentials,New To Java...