I have a very simple class displaying a jTable, where in column1 I have added a combobox
public class Table extends javax.swing.JFrame {
public Table() {
initComponents();
TableColumn name = jTableProva.getColumnModel().getColumn(1);
JComboBox combo = new JComboBox();
combo.addItem("Rain");
combo.addItem("Snow");
combo.addItem("Sunny");
name.setCellEditor(new DefaultCellEditor(combo));
}
My questions:
1) I don't know why combos always appears hidden or "behind" cells when run.
2) I would like to add a JColorChooser
in column 2. How can I accomplish this using the Netbeans swing component code? I have added a JColorChooser
by drag and drop from palette.
Thanks.
Absent your sscce, it's not clear what the problem might be. You can compare what you're doing with this working example that shows a
DefaultCellEditor
having aJComboBox
. Using a Combo Box as an Editor also shows aJComboBox
; Using Other Editors shows aJButton
that launches aJColorChooser
.