I can't seem to add a JComboBox
to Jtable
. I do not know what is wrong with my code. I have tried the example at
http://docs.oracle.com/javase/tutorial/uiswing/components/table.html.
It just doesn't work.
Here is my code.
JComboBox comboBox = new JComboBox();
comboBox.addItem("Snowboarding");
comboBox.addItem("Rowing");
comboBox.addItem("Chasing toddlers");
comboBox.addItem("Speed reading");
comboBox.addItem("Teaching high school");
comboBox.addItem("None");
editAddressFrm.getAddressTable().getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(comboBox));