Re: Resetting JTables




"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


.



Relevant Pages

  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)
  • Re: OT: SQL
    ... query processing. ... FROM Employees e, Employees m, Management mgt ... Manager and Employee Salaries. ... The scheme used does not model database files in general, ...
    (sci.logic)
  • Re: access 2003
    ... I removed the parameters from the form query source. ... boxes from the form header, events, code, etc and ran the form query source ... forms queries and the SQL because syntax of the SQL will change randomly. ... the Access 97 database, I wouldn't have thought any expressions would be ...
    (microsoft.public.access.conversion)
  • RE: Import external data - web query
    ... Your reply for my query is very extensive, this is for importing a file from ... The data source I want isn't listed in the Select Data Source dialog box. ... information used to connect to a database. ... Check your driver First, make sure you have the right ODBC driver (Open ...
    (microsoft.public.excel.misc)
  • Re: access 2003
    ... I removed the parameters from the form query source. ... synchronize combo boxes to the detail section or the parameter form query ... forms queries and the SQL because syntax of the SQL will change randomly. ... the Access 97 database, I wouldn't have thought any expressions would ...
    (microsoft.public.access.conversion)