• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JComboBOx in a Jtable

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
I have a column in a JTable that needs to display values in a JComboBox. My problem is that the contents of the comboBox are different for each row of the JTable.
Can someone direct me on how to program this ?
Thanks in advance
Jean Richard
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would be the same way as filling the table's cells with individual values. In your case I would write a table model that returns for this column a set of the appropriate possible values (e.g. an array of values or a self written data class that encapsulates the values) and a table cell renderer for this column that returns a combobox with the appropriate content.
Tom
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic