Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Gui button with calendar popup

 
John Vorwald
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form where the date should be entered. Right now, I enter a text format. I would like to add a calendar popup to allow selection of the date. The calendar should allow switching year since most of the dates would be from more than 6 years ago.

Can you provided suggestions on how to implement a calendar popup? Is this part of swing?

John
 
Paul Clapham
Sheriff
Posts: 21298
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I typed "java calendar popup" into Google and got this as the first link returned: Java Swing Calendar Popup Button.

I haven't reviewed this code in any way but if you're looking for the feature (instead of a coding opportunity) I recommend you do that. It's not the only possibility I got from my web search either.
 
John Vorwald
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the suggestion, I did try a few google searches.
Here are some other good links, but haven't tried them yet:
http://www.java2s.com/Product/Java/Swing/Calendar-Date-Time.htm
http://www.java2s.com/Code/Java/Swing-Components/JavaDateChooserComboBox.htm

John
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have implemented a Calendar popup inside a Combo Box using one such resource. I don't remember the resource source. I have attached here the DateComboBox i have used.
It should be initialized like below


 
John Vorwald
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that works fine...

John
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic