Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable List Field?

 
David Sham
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Sham
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured as much, but was not entirely sure. Thanks Jared.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic