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 / May 2005

Tip: Looking for answers? Try searching our database.

reading values from JTable

Thread view: 
Robert Metzger - 18 May 2005 21:52 GMT
I am looking for a working example of a JTable that is constructed
with initial values in the cells, allows the user to change those values,
and reads the values out.

I've got three books on Swing, none of them show a write/read table.

I have no problem creating tables with nothing in some cells, and
reading the values out that the user entered.

Here is how I construct the tables:

DefaultTableModel model01= new DefaultTableModel(rowData,colNames);
JTable table01= new JTable(model01);

Any help greatly appreciated.
Signature

Robert Metzger          
Hewlett-Packard Company
High Performance Computing Division

Dag Sunde - 18 May 2005 22:41 GMT
> I am looking for a working example of a JTable that is constructed
> with initial values in the cells, allows the user to change those values,
[quoted text clipped - 9 lines]
> DefaultTableModel model01= new DefaultTableModel(rowData,colNames);
> JTable table01= new JTable(model01);

Extend/implement AbstractTableModel, and implement getValueAt(),
setValueAt() and
isCellEditable()...

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

Signature

Dag.



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.