Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2006

Tip: Looking for answers? Try searching our database.

Updating JTable

Thread view: 
Nandu - 26 Mar 2006 23:50 GMT
I created 3 JTables 2X2 each and all the tables are empty,.. Now i want
to update each of the JTable cells. How can i do that.
i created Jtable as follows
JTable Table;  // i created  3 table varaibles TableOne, TableTwo,
TableThree
DefaultTableModel model; // i used the same model for all tables

   When i created a program with  single JTable, i used to update with
following commands

model.insertRow(Integer.parseInt(iterno)-1, new Object[] {iterno ,
host_choice, });
model.removeRow(Integer.parseInt(iterno));

Now i have one 'model' and 3 tables, how can i update all the three
tables with single 'model'. or should i have to create 'model' for each
JTable

Thank you
Oliver Wong - 28 Mar 2006 19:30 GMT
>I created 3 JTables 2X2 each and all the tables are empty,.. Now i want
> to update each of the JTable cells. How can i do that.
[quoted text clipped - 13 lines]
> tables with single 'model'. or should i have to create 'model' for each
> JTable

   If you associate the same model with all 3 tables, whenever you update
the model, the 3 tables should automatically update themselves. If this
doesn't work, perhaps you can post an SSCCE demonstrating the problem. See
http://mindprod.com/jgloss/sscce.html

   - Oliver


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.