File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
Java in General
Clearing data from a jTable
Joined: May 03, 2004
Dec 07, 2004 10:49:00
Is there an easy way to clear all data from a jTable. I've tried the table.removeAll(), which seemed sensible, but doesn't work.
Also how do you extract a value from a cell into a variable??
Joined: Dec 07, 2004
Dec 07, 2004 15:03:00
You can use these methods of
1. setDataVector(Vector newData, Vector columnNames)
-- If you want the clear the exisitng contents of the table, pass a empty data vector
2. getValueAt (int row, int column)
-- This method returns the value present in a cell
You can also write your own model by extending
It is sorta covered in the
JavaRanch Style Guide
subject: Clearing data from a jTable
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014