adrianjohnson
Programmer
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
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