【发布时间】:2013-03-18 12:26:17
【问题描述】:
我有一个有 4 列的 jtable,其中最后一列有一个组合框,
示例代码
String[] colNames = {"Name","Email","Department","Status"};
TableModel model = new DefaultTableModel(colNames,200);
table.setModel(model);
TableColumn statusCol = table.getColumnModel().getColumn(3);
comboBox = new JComboBox();
comboBox.addItem("Approver");
comboBox.addItem("Senior Manager");
statusCol.setCellEditor(new DefaultCellEditor(comboBox));
这里的组合框有 2 个选项批准者和高级经理,我正在寻找一种添加条件的方法,表格中只有一个高级经理?
【问题讨论】:
-
请问
I am looking for a way to add condition as, only one senior manager in the table?是什么@嗯,看看我的question about prepareEditor -
请出示证明问题的SSCCE
标签: java swing jtable jcombobox