How to clear data in Jtable in JScrollPane
I have a jTable in a JScrollPane.I want to clear all the data in Jtable if i click on a menu item.I tried clearing it by first fetching the data model and then removing all its elements.
DefaultTableModel dm = (DefaultTableModel)tabel.getModel();
Sometimes data is removed but most of the times elements are removed very slowly.Also if a window is opened on table data taht area of jtable gets cleared which seems very wierd.I want them to be removed the quickly when I click on clear.
Anyone know the solution for this
Thanks in advance,