wood burning stoves 2.0
The moose likes Swing / AWT / SWT and the fly likes how to create a Calendar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to create a Calendar" Watch "how to create a Calendar" New topic

how to create a Calendar

Praveen Sharma
Ranch Hand

Joined: Jul 31, 2008
Posts: 129
I am new to Swing. I want to add a calendar control to my swing application. Please suggest me how to create a calendar component.

SCJP 80% SCWCD 89%
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10570

Well you will need the following things
1) A panel or some suitable container with a grid layout
2) Labels to display the week days as well as the dates
3) GregorianCalendar has all the methods you will require to figure out stuff like leap year, number of days in a month, day on a particular date etc.
4) If you want to make the calendar more interactive (user clicks on some date and views say his appointments for that particular date, use buttons instead of labels.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
zohaib shiekh

Joined: Apr 03, 2011
Posts: 4
JCalender provide a facility to integrate Calender component with your Swing application
Download this Component from webpage
and mzohaib91.blogspot.com
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 40476
Is that the same as this calendar?
zohaib shiekh

Joined: Apr 03, 2011
Posts: 4
No this component is more easy then this
its very easy to integrate with swing
Don't get me started about those stupid light bulbs.
subject: how to create a Calendar