Log in

View Full Version : Jcombobox in jtable


nicyoda
Feb 23, 2013, 04:59 PM
I am setting a JComboBox in a JTable. The first item in the JComboBox is the JComboBox string object:

javax.swing.JComboBox[,0,0,0x0,invalid,layout=javax.swing.plaf.metal.Met alComboBoxUI$MetalComboBoxLayoutManager,alignmentX =0.0,alignmentY=0.0,border=,flags=328,maximumSize= ,minimumSize=,preferredSize=,isEditable=false,ligh tWeightPopupEnabled=true,maximumRowCount=8,selecte dItemReminder=]

If I click on the JComboBox in the table column, it opens up with the items I have added.

TableColumn col = Table.getColumnModel().getColumn(1);
col.setCellEditor(new DefaultCellEditor(myJcomboBox);

I just can't figure this out. Any answers?
Thanks