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 / General / January 2006

Tip: Looking for answers? Try searching our database.

JTable - help

Thread view: 
JacQ_21 - 01 Jan 2006 17:30 GMT
Hi

I have a problem with JTable - i would like to reedit whole data like
this was on the beggining with default constructor   like :    JTable
table =new JTable(matrix1,matrix2);

When program runs i like to use different kind of data in this same
table( without erasing it ) - how to change it ?
Thank you very much
Sorry for my English - Poland
All the best
VisionSet - 01 Jan 2006 18:03 GMT
> Hi
>
[quoted text clipped - 7 lines]
> Sorry for my English - Poland
> All the best

If I understand you you wish to make updates to the tables data and these be
reflected in the JTable automatically.
To achieve this painlessly a good approach is to create a class that extends
AbstractTableModel and use this to create your JTable in JTables
constructor.  All model updates will then fire JTables internal listener and
make the updates automatic.

--
Mike W
andreas kinell - 01 Jan 2006 18:18 GMT
> Hi
>
[quoted text clipped - 7 lines]
> Sorry for my English - Poland
> All the best

Try writing your own custom TableModel.
Then you could write a method called setValues(Matrix m1, Matrix m2)
which sets the matrices for you.

To detect changes to the model and update the JTable, use a
TableModelListener.

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data

HTH, andreas
JacQ_21 - 01 Jan 2006 21:00 GMT
Thank you all very much - it helped.
Big Thx


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.