Re: Resetting JTables
- From: "Rhino" <no.offline.contact.please@xxxxxxxxxx>
- Date: Fri, 7 Jul 2006 10:01:45 -0400
"cp" <e-blade@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:44ada043$0$67260$157c6196@xxxxxxxxxxxxxxxxxxxxxxxx
I'm running out of ideas on this. Basicly I wrote my own console to act as
a
more userfriendly interface to interact with an underlyding MySQL
database.
Whenever i issue a query i get a pop-up window displaying the results in a
JTable.
My problem is that I would like to reset / re-initialize this JTable so
that
the next query I issue, clears the JTable and populates the table with the
news result.
I have tried resetting the model of the table using:
DefaultTableModel model = new DefaultTableModel(data, columnNames);
table.setModel( model );
But that doesnt seem to work, it just displays the result below the
results
of the original query.
I add the coloums and rows of the query-result into two seperate vectors.
Any idea?
I haven't tried this myself but shouldn't you be executing the
fireTableRowsDeleted() method from AbstractTableModel after you delete the
old rows and then fireTableRowsInserted() from the same class after you have
added the new rows?
--
Rhino
.
- References:
- Resetting JTables
- From: cp
- Resetting JTables
- Prev by Date: Resetting JTables
- Next by Date: add JDBC driver for MySQL to apache-tomcat-5.5.17
- Previous by thread: Resetting JTables
- Next by thread: Re: Resetting JTables
- Index(es):
Relevant Pages
|
|