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 / GUI / November 2003

Tip: Looking for answers? Try searching our database.

JTable

Thread view: 
Thierry - 22 Nov 2003 21:43 GMT
Hello,

I'd like to use Jtable in my JApplet.

I do :

String[] columnNames = {"lala", "toto", "mama" };
String[][] values = {
    { "val1", "val2", "val3" },
    { "toto1", "toto2", "toto3"}
};
JTable table = new JTable(values, columnNames);
myScrollPane.add(table);
...

This does work !

But I do not find how to change the values (and column names) of the
table. I tried Vectors instead of arrays, hoping that updateUI() would
update the table after a vector's change but no :-(

Any idea would be welcome...

Thx, Thierry
ak - 23 Nov 2003 21:17 GMT
if you want mutable table you must create JTable with TableModel

> Hello,
>
[quoted text clipped - 20 lines]
>
> Thx, Thierry
Thierry - 23 Nov 2003 22:09 GMT
Can you give an example pls ?

Thx

> if you want mutable table you must create JTable with TableModel
>
[quoted text clipped - 22 lines]
>>
>>Thx, Thierry
Christophe Vanfleteren - 23 Nov 2003 22:14 GMT
>>>But I do not find how to change the values (and column names) of the
>>>table. I tried Vectors instead of arrays, hoping that updateUI() would
[quoted text clipped - 7 lines]
>
> Thx

Read http://java.sun.com/docs/books/tutorial/uiswing/components/table.html,
it explains the relation between a JTable and a TableModel.

Signature

Regards,
Christophe Vanfleteren

Thierry - 24 Nov 2003 07:09 GMT
> Read http://java.sun.com/docs/books/tutorial/uiswing/components/table.html,
> it explains the relation between a JTable and a TableModel.

Actually, I did... but I don't get the part about the TableModel :-(


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.