The Artima Developer Community
Sponsored Link

Java Answers Forum
Updating a JTable

1 reply on 1 page. Most recent reply: Mar 25, 2005 2:16 AM by andy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
andy

Posts: 6
Nickname: chant9
Registered: Mar, 2005

Updating a JTable Posted: Mar 24, 2005 1:54 PM
Reply to this message Reply
Advertisement
I have a button that creates a table that can vary in size each time but the way im doing it just keeps adding new tables next to the existing tables. The code im using is below.

Object[][] data = table;
JTable tableT = new JTable(data, columnNames);
tablePanel.add(tableT);

Can anyone suggest a way that i can update a table rather than create a new one each time or remove the existing table before i insert a new table.

Any help will be apprieciated.

Cheers


andy

Posts: 6
Nickname: chant9
Registered: Mar, 2005

Re: Updating a JTable Posted: Mar 25, 2005 2:16 AM
Reply to this message Reply
Just updating, I managed to do this using setModel.

Flat View: This topic has 1 reply on 1 page
Topic: 2 quick ones Previous Topic   Next Topic Topic: Updating JLabel shows the preious text behind.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use