views:

48

answers:

3

Is it possible to add a DateTimePicker to a JTable Cell.A particular column should be updated with date and time..Is it possible to add such a component to a JTable

+2  A: 

Yes it is. See this Swing Tutorial Track: http://download.oracle.com/javase/tutorial/uiswing/components/table.html#combobox

Jens Schauder
-300 because the Tutorial does not mention any Editor for Date and Time; just a Renderer for a Date.
bobndrew
+1, yes the tutorial doesn't give a specific example of a date editor, but it does show how to use a color chooser as an editor. So the concept will be the same. All the OP has to do is find a Date editor that they like to use. There are many date editors floating around on the web.
camickr
+1  A: 

Try to use the FLib-JCalendar component as an CellEditor in a JTable.
(and post the working example here if you made it work)

bobndrew
@bobndrew: Can you elaborate? It's not clear if you found the component difficult to use.
trashgod
+1  A: 

Yes, but you'll need to implement both TableCellRenderer and TableCellEditor. As suggested by @Jens Schauder, the tutorial may be helpful. You might also look at this tutorial based example using JCheckBox.

trashgod