aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Using Calendar class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Using Calendar class " Watch "Using Calendar class " New topic
Author

Using Calendar class

nirmal Rchavan
Ranch Hand

Joined: Jul 10, 2007
Posts: 35
Hi All,
Its nice to know there is forum like this to help us all GreenHorns..

I would like to know is there a Calendar component in swings like "JCalendar" or some thing.
I have designed a popupcalendar using the regular swing components where i have made use of Calendar class
Calendar c = Calendar.getInstance();
and i am extracting individual fields such as time, day, year etc...
using
c.get(c.YEAR),c.get(c.MONTH)etc... value returned by these functions are integers (00-for january,01- for feb) and 07- for current year.
However, how i wanted in my application is in string format like
Jan,Feb..for months
and 2007,2008..for years.


Thanks in advance.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39885
    
  28
Not sure I can help you a lot, but Horstmann's book says to look on www.toedter.de for a reusable Calendar display.

And welcome to the Ranch.

Go through the documentation for java.util.Formatter here, and find the formatting tabs which begin with %t or %T. You will find several different ways to print months there.
nirmal Rchavan
Ranch Hand

Joined: Jul 10, 2007
Posts: 35
Thanks a lot sheriff..
that definatly helped, i am able to extract the required fields now.
nirmal Rchavan
Ranch Hand

Joined: Jul 10, 2007
Posts: 35
Thanks a lot sheriff..
that definatly helped, i am able to extract the required fields now.
 
Don't get me started about those stupid light bulbs.
 
subject: Using Calendar class