Forums Register Login

problem with JTable - while inserting JComboBox (DateComboBox)

+Pie Number of slices to send: Send
Hi there,

here is the deal: I have a dateComboBox (works PERFECT), I implemented it on a JTable:


DateComboBox dateCB = new DateComboBox();
dateCB.setEditable(true);

//add datecombobox
TableColumn dateColumn = table.getColumnModel().getColumn(1);
dateColumn.setPreferredWidth(100);
DefaultCellEditor dce1 = new DefaultCellEditor( dateCB );
dateColumn.setCellEditor(dce1);

The result is as I want. Once the user clicks on the 2nd column, the DateComboBox is open and the user can click on the desired date. HOWEVER, for some reason, once the user clicka on that date it doesn't appear in the cell???

the cells are editable (so as the dateComboBox) so if he TYPES somthing else (string,int...)- it works great.

any idea why the happens?

Thanks
Ppr
+Pie Number of slices to send: Send
Did you also set a TableCellRenderer for the column?
+Pie Number of slices to send: Send
THANKS Craig,

i found the err in the datecombobox.
no wonder he is so sad, he hasn't seen this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1164 times.
Similar Threads
jtable
JDateChooser in JTable
jtable
JTable: highlight text of cell
JTable(!!!)
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:28:50.