Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with JTable - while inserting JComboBox (DateComboBox)  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you also set a TableCellRenderer for the column?
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THANKS Craig,

i found the err in the datecombobox.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!