Reputation: 1
code i have used is as follows .. bt it gives classCastException when i click on jcalendarcombo present in jtable cell. pls help me.. thanks in adv.
TableColumn closedDateColumn = resultTable3.getColumnModel().getColumn(7);
MyDateListener listener1 = new MyDateListener();
cmbCalanderDate = new JCalendarCombo(JCalendarCombo.DISPLAY_DATE, true); //Calander Combobox for selecting date
cmbCalanderDate.setDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
closedDateColumn.setCellEditor(new DefaultCellEditor(cmbCalanderDate));
cmbCalanderDate.addDateListener(listener1);
Upvotes: 0
Views: 408
Reputation: 7126
You need a JDateChooserCellEditor
like they show here.
closedDateColumn.setCellEditor(new new JDateChooserCellEditor());
Another way is to use setDefaultEditor()
.
table.setDefaultEditor(Date.class, new JDateChooserCellEditor());
Upvotes: 1