File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to make a calender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to make a calender" Watch "How to make a calender" New topic
Author

How to make a calender

rk sharma
Ranch Hand

Joined: Jun 25, 2011
Posts: 50

How to make a calender in JAVA that can take a date format and then display the corresponding just like a normal calender date in graphical mode. the code shold not contain any predefined API. Please help me any one by just saying the algorithm. And the the design steps....


Regards,

RK
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

I don't think you can achieve what you want, without using pre-defined API (for example, Swing...) as JAVA is made of pre-defined APIs. ;)


S.D. MADHAN
Not many get the right opportunity !
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 557
The OP probably means that existing APIs that provide calendar and date functions can't be used.

Here's a rough outline of what must be done:

Hopefully, there's a reasonable bound to the problem; beginning and end dates for which your program must work. I'll assume so.

1. Get a date from the user (month/year).
2. Check that the date is valid: between the upper and lower bounds, a real month/year, etc.
3. Determine the starting day for the user's month and year.
a. Based on knowledge of one day within the bounded dates
b. Determine the leap years between known date and user date
c. Calculate the starting day of the user's month.
4. Determine the number of days in the user's month
5. Using result of 3 and 4, print the user's month/year.
a. Typical format:
Month/Year
S M T W T F S
(skip the number of days before the correct start date, then print the dates.)
5. Continue until the user is done.


Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795
Jim Hoglund
Ranch Hand

Joined: Jan 09, 2008
Posts: 525
What do you want to do with the displayed date/calendar after it has been displayed?

Jim ... ...


BEE MBA PMP SCJP-6
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make a calender
 
Similar Threads
how to make a calendar using Date, Calender and Data Class
String to Date???
Problem while using Calender Components
Downcasting And Upcasting
How to insert date values to database using java swings