Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calendar

 
Chandra Moulee
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can we display a calendar using java.

Thanks

Mouli
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there's a couple of parts to the display
1) a panel with 49 buttons or labels (7 x 7)
top row dispays the days of the week (Sun Mon Tue etc)
remaining 6 rows display the dates of the month
2) another panel with previous/next buttons (previous/next month)

put them together in a JDialog and you have a popup calendar

you need to work on getting the DAY_OF_WEEK of the first of the month to
determine which button displays "1", then increment the buttons from there
until getActualMaximum() is reached
 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Someone has actually developed something like this and has made it available for free. I use this one and it works really nicely.

Take a look if you don't want to create your own from scratch.

http://www.toedter.com/en/jcalendar/

Cheers, Jared.
 
Stephen Boston
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And I found THIS very helpful.

Steve
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic