【发布时间】:2018-11-08 22:18:44
【问题描述】:
我已经使用 ComboBoxTableCell 在表格单元中设置了一个组合框,现在我希望此组合框可编辑,以便用户可以相应地对其进行编辑。我已将组合框的可编辑属性设为 true,但没有成功。下面是代码。
ComboBoxTableCell combo = new ComboBoxTableCell();
tc_target.setCellFactory(combo.forTableColumn(new
DefaultStringConverter(), trans));
tc_target.setOnEditCommit(new
EventHandler<TableColumn.CellEditEvent<File, String>>() {
@Override
public void handle(TableColumn.CellEditEvent<File, String>event) {
//work to do
}
});
combo.setEditable(true);
如何使这个组合框可编辑?很高兴得到任何建议。
【问题讨论】: