File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes JTable List Field? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "JTable List Field?" Watch "JTable List Field?" New topic

JTable List Field?

David Sham
Ranch Hand

Joined: Apr 19, 2005
Posts: 61
One of the columns in my assignment(B&S) actually contain data that could be put into a list. This would be the "specialties" column in the database file. It's nothing but a comma separated list of string values, usually no more than 3 or 4 "specialties" per table row.

I present the data simply as is in my JTable. The table cell appears as: "value1, value2, value3", like so.

Do you think I will lose points for presenting this data this way? Should I use some other GUI component in the table cell to show this data, and if so what component? A combo box is used for selecting an item from a list. No selection is occurring here for these items. Is there some kind of list component (maybe a JTextArea?) I can use to show these values in list fashion? Or is this again beyond scope?

Any input is appreciated. Thanks.
Jared Chapman
Ranch Hand

Joined: Feb 23, 2004
Posts: 81
Hey David,

I played with the idea of doing something with these values, too. After all, in the real world these values should be separated, so a search could be performed on a particular specialty. But it is beyond the scope of the assignment. Just leave these values in a single string.

B.S. University of Wisconsin<br />SCJP 1.4 (85%)<br />SCJD 1.4 (92%) B&S Contractors
David Sham
Ranch Hand

Joined: Apr 19, 2005
Posts: 61
I figured as much, but was not entirely sure. Thanks Jared.
I agree. Here's the link:
subject: JTable List Field?
It's not a secret anymore!