Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Calendar program in java

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 01-12-2009
Member
 
Join Date: Nov 2009
Posts: 138
Calendar program in java
  

Hello,

I am creating a program in java, but the problem is that i am a fresher in development of java program. This is my office project on which i am working to update the record of the user for complete month, but i don't know how to do that and which object will define the same. I cant take any help in my office because it is about my reputation. So i finally posted my query here to get help regarding that. So help me if any one have the solution and its urgent.

Thanks in advance.

Reply With Quote
  #2  
Old 01-12-2009
Member
 
Join Date: May 2008
Posts: 4,829
Re: Calendar program in java

Hi,

It not a big deal to maintain the user information of complete month on the java. All you have to do, make a calendar object which will keep the 12 month object . And another method is to use a abstract interface for month and create first month object for implementing the month interface. But make sure that each month will have the display() method to display the same. I hope understand the concept of the calendar object. Now use it to fully enjoy the function.

Thats it!!!!!!!!!!!!
Reply With Quote
  #3  
Old 01-12-2009
Member
 
Join Date: Apr 2008
Posts: 4,096
Re: Calendar program in java

Hi,

Here are the simple code to develop a calender program in the java. use it to update the record of the user.

Code:
import java. swing.*;
import java.awt.event.*;
import java.util.Calendar;
class CalendarExample 
{
public static void main(String args[]) 
{

String months[] = 
{"Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec"};
Calendar calendar = Calendar.getInstance();
System.out.println("Present Date: ");
System.out.println(Months[calendar.get(Calendar.MONTH)]);
System.out.println(" " + calendar.get(Calendar.DATE) + " ");
System.out.println(calendar.get(Calendar.YEAR));
System.out.println("Present Time: ");
System.out.println(calendar.get(Calendar.HOUR) + ":");
System.out.println(calendar.get(Calendar.MINUTE) + ":");
System.out.println(calendar.get(Calendar.SECOND));
calendar.set(Calendar.HOUR, 10);
calendar.set(Calendar.MINUTE, 29);
calendar.set(Calendar.SECOND, 22);
System.out.println("Edit time: ");
System.out.println(calendar.get(Calendar.HOUR) + ":");
System.out.println(calendar.get(Calendar.MINUTE) + ":");
System.out.println(calendar.get(Calendar.SECOND));
}
}
__________________
Ram requirement for various OS
Reply With Quote
  #4  
Old 01-12-2009
Member
 
Join Date: Apr 2008
Posts: 2,139
Re: Calendar program in java

Its a better way to use the simpler date class to develop the pure date calculations program which will be used when you want to solve the difficulty TimeZones and times. So better to use the classes which i am giving you to help with the calendar issue.

Code:
com.mindprod.common11.BigDate
java.text.DateFormat
java.text.SimpleDateFormat
java.util.Calendar
java.util.Date
java.util.GregorianCalendar
java.util.TimeZone
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Calendar program in java"
Thread Thread Starter Forum Replies Last Post
Dr. Java program bamggut29 Software Development 2 26-11-2011 03:24 AM
help me to understand java code (calendar java code) ? so0oma Software Development 2 09-01-2011 11:01 PM
Help me program a calculator in java Kelvin Little Software Development 4 28-06-2010 05:55 PM
Calendar API in java Miles Runner Software Development 5 05-02-2010 04:23 AM
Link List Example in Java Sample program in Java trickson Software Development 2 04-08-2009 08:23 PM


All times are GMT +5.5. The time now is 06:04 AM.