Skip to main content

HOw to get value in Jcombobox?

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2011-06-16

Hi All,

In my DefaultTableModel's Jtable one column has JCombobox. My problem is when i click the button it should display the selected value of perticular row's Combobox value. I am using getValueAt for getting Other columns values. But i don't know how to get values in Jcombobox in Jtable. Any one Can help me?

Sample Code:
public String[] values = {"A", "B", "C"};
JComboBox combo = new JComboBox(values);
TableColumn tbcol = table1.getColumnModel().getColumn(2);
tbcol.setCellEditor(new DefaultCellEditor(combo));

I ahve render also.But if the user not slected anything,in model.getDateCetor null value is coming.