• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to insert JDatePicker to JTable column

 
joe encalada
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all. Now I'm facing this problem. Somebody ask me to use a datepicker(Jdatepicker-1.3.4) on a Jtable and I have read some information about using editors and renderers.

So far. I have a simple JTable and using line below I get the JDatePicker on column 3.

Here my renderer.

Here is my problem. When I click on the JDatePicker of column 3 nothing happens, I guess is matter of get an editor for that column too, but I dont know how. Can you suggest me how to do it?
 
Rob Camick
Ranch Hand
Posts: 2714
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the section from the Swing tutorial on Using Other Editors.

It shows how to use a JColorChooser and an editor. The concept will be similar for a JDatePicker.
 
joe encalada
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I'm gonna read it. Thank you.
 
Campbell Ritchie
Marshal
Posts: 53168
124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which date picker are you using? Tödter's?
 
joe encalada
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using datepicker(Jdatepicker-1.3.4). JDatePicker
 
joe encalada
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all, I've found Custom Editor but using JSpinner. It is quite similar, anyway here is the code:

I hope it could be helpfull to somebody.
 
joe encalada
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the webpage. From I get the Custom Editor using JSpinner.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!