我如何在列项目日期,时间和时间的jtable中添加datepicker和timepicker?

时间:2017-08-30 07:18:01

标签: java swing netbeans-8

我如何在列项目日期的datepicker内添加timepickerjtable,从时间到时间?

我已在combobox中添加了jtable

Screen Shot is added of my GUI enter image description here

1 个答案:

答案 0 :(得分:1)

TableColumn dateColumn = jTable1.getColumnModel().getColumn(4);
dateColumn.setCellEditor(new TimeTableEditor());
TableColumn dateColumn1 = jTable1.getColumnModel().getColumn(5);
dateColumn1.setCellEditor(new TimeTableEditor());
TableColumn dateColumn3 = jTable1.getColumnModel().getColumn(0);
dateColumn3.setCellEditor(new DateTableEditor());

使用 LGoodDatePicker-GitHub https://github.com/LGoodDatePicker/LGoodDatePicker并将上述代码放在JTable的PropertyChange中。(0,4,5)是列索引。< / p>