The moose likes Swing / AWT / SWT / JFace and the fly likes JComboBOx in a Jtable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "JComboBOx in a Jtable" Watch "JComboBOx in a Jtable" New topic
Author

JComboBOx in a Jtable

Jean Richard
Greenhorn

Joined: Sep 10, 2001
Posts: 1
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
Thomas Suer
Ranch Hand

Joined: Sep 03, 2001
Posts: 50
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
 
 
subject: JComboBOx in a Jtable
 
Threads others viewed
JTable action listener
How to populate different values into JComboBox in JTable
JTable
JTable
JTable ........
IntelliJ Java IDE