H
hinz.adam
I would like to use combo boxes in my tables but have different values
in combo boxes that are in the same column. If found the following
example on the java website:
TableColumn sportColumn = table.getColumnModel().getColumn(2);
....
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");
sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
But this example only allows the same combo box for every row. How can
I fix this?
Thanks,
Adam
in combo boxes that are in the same column. If found the following
example on the java website:
TableColumn sportColumn = table.getColumnModel().getColumn(2);
....
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");
sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
But this example only allows the same combo box for every row. How can
I fix this?
Thanks,
Adam