Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JTable row headers and DefaultTableModel

Status
Not open for further replies.

adrianjohnson

Programmer
May 16, 2002
145
GB
Hi all,

I have 2 problems in Java, which I would like help with:

1. Is it possible to have row headers in a JTable? I did a quick search on Google, but couldn't find much on it. I thought of adding lables into the first column to use as headers, but wasn't sure if there was something already built in.

2. Building on 1., I know how to add a row of data, using the DefaultTableModel, but I'd prefer to add a column of data at a time. Any ideas how, as the code I've used adds a complete row, not a complete column.

An example of what I'm trying to achieve is the query builder in MS Access - where you select a field from the database, and it adds a column in the table (Field, Table, Sort etc.).

Hope I've explained it properly. I'm ready for home - been a tough day.

Thanks,

Adrian Johnson

Windows XP, Java 1.5, NetBeans 4.1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top