Add to Favorites    Make Home Page 134443 Online  
 Language Categories  
 Our Services  

Home » Java Home » Beginners / Lab Assignments Home » Hundred Year Calender(2001-2100)

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Hundred Year Calender(2001-2100)
Author kiran mandadi
Author Email kiron_1212 [at] yahoo.co.in
Description The program provides to search a dayis i.e monday or tuesday...... between 2001-2100
Please enter months in short form i.e
jan,feb,mar,apr,jun,jul.................
Category Java » Beginners / Lab Assignments
Hits 374432
Code Select and Copy the Code
/* <applet code="calender2" width=380 height=280> </applet> */ import java.applet.*; import java.awt.*; import java.awt.event.*; import java.net.*; import java.io.*; public class calender2 extends Applet implements ActionListener,Runnable { Label l1,l2,l3; TextField t1,t2,t3,t4; Button b1; String s1,m1,bname,mon; int y1,d1,n,date,year; char a; public void init() { l1=new Label("Enter Year: "); l2=new Label("Enter Month: "); l3=new Label("Enter Date: "); t1=new TextField(15); t2=new TextField(15); t3=new TextField(15); t4=new TextField(15); b1=new Button("Day is: "); setBackground(Color.lightGray); setForeground(Color.red); Font f=new Font("Arial",1,20); setFont(f); add(l1); Color c1=new Color(150,50,200); setForeground(c1); add(t1); setForeground(Color.red); add(l2); setForeground(c1); add(t2); setForeground(Color.red); add(l3); setForeground(c1); add(t3); setForeground(Color.red); add(b1); Color cl=new Color(100,0,200); setForeground(Color.magenta); add(t4); b1.addActionListener(this); FlowLayout fl=new FlowLayout(); setLayout(fl); } String msg1="k",msg2="N",msg3="o",msg4="t",msg5="e",msg6=":",msg7="E",msg8="n",ms g9="t",msg10="e",msg11="r",msg12="Y",msg13="e",msg14="a",msg15="r",msg16=" I",msg17="n",msg18="2",msg19="0",msg20="0",msg21="0",msg22="-",msg23="2",m sg24="1",msg25="0",msg26="0"; int i; public void start() { Thread t=new Thread(this,"a"); t.start(); } public void run() { try { for(int i=0;i<100;i++){ setForeground(Color.red); paint1(); Thread.sleep(300); paint2(); Thread.sleep(300); paint3(); Thread.sleep(300); paint4(); Thread.sleep(300); paint5(); Thread.sleep(300); paint6(); Thread.sleep(300); paint7(); Thread.sleep(300); paint8(); Thread.sleep(300); paint9(); Thread.sleep(300); paint10(); Thread.sleep(300); paint11(); Thread.sleep(300); paint12(); Thread.sleep(300); paint13(); Thread.sleep(300); paint14(); Thread.sleep(300); paint15(); Thread.sleep(300); paint16(); Thread.sleep(300); paint17(); Thread.sleep(300); paint18(); Thread.sleep(300); paint19(); Thread.sleep(300); paint20(); Thread.sleep(300); paint21(); Thread.sleep(300); paint22(); Thread.sleep(300); paint23(); Thread.sleep(300); paint24(); Thread.sleep(300); paint25(); Thread.sleep(300); paint26(); Thread.sleep(300); repaint();} } catch(Exception e) { System.out.print(" thread interrupted"); } } public void paint1() { } public void paint2() { Graphics g=getGraphics(); g.drawString(msg2,65,200); } public void paint3() { Graphics g=getGraphics(); g.drawString(msg3,78,200); } public void paint4() { Graphics g=getGraphics(); g.drawString(msg4,90,200); } public void paint5() { Graphics g=getGraphics(); g.drawString(msg5,97,200); } //note public void paint6() { Graphics g=getGraphics(); g.drawString(msg6,107,200); } //: public void paint7() { Graphics g=getGraphics(); g.drawString(msg7,114,200); } public void paint8() { Graphics g=getGraphics(); g.drawString(msg8,127,200); } public void paint9() { Graphics g=getGraphics(); g.drawString(msg9,140,200); } public void paint10() { Graphics g=getGraphics(); g.drawString(msg10,146,200); } public void paint11() { Graphics g=getGraphics(); g.drawString(msg11,156,200); } //enter public void paint12() { Graphics g=getGraphics(); g.drawString(msg12,172,200); } public void paint13() { Graphics g=getGraphics(); g.drawString(msg13,184,200); } public void paint14() { Graphics g=getGraphics(); g.drawString(msg14,194,200); } public void paint15() { Graphics g=getGraphics(); g.drawString(msg15,204,200); } //year public void paint16() { Graphics g=getGraphics(); g.drawString(msg16,220,200); } public void paint17() { Graphics g=getGraphics(); g.drawString(msg17,225,200); } //in public void paint18() { Graphics g=getGraphics(); g.drawString(msg18,241,200); } public void paint19() { Graphics g=getGraphics(); g.drawString(msg19,251,200); } public void paint20() { Graphics g=getGraphics(); g.drawString(msg20,261,200); } public void paint21() { Graphics g=getGraphics(); g.drawString(msg21,271,200); } //2000 public void paint22() { Graphics g=getGraphics(); g.drawString(msg22,283,200); } //- public void paint23() { Graphics g=getGraphics(); g.drawString(msg23,290,200); } public void paint24() { Graphics g=getGraphics(); g.drawString(msg24,300,200); } public void paint25() { Graphics g=getGraphics(); g.drawString(msg25,310,200); } public void paint26() { Graphics g=getGraphics(); g.drawString(msg26,320,200); } //2004 public void actionPerformed(ActionEvent ae) { bname=ae.getActionCommand(); y1=Integer.parseInt(t1.getText()); mon=t2.getText(); d1=Integer.parseInt(t3.getText()); if(bname.equals("Day is: ")) { a=findyear(y1); n=findmoncode(a,mon); findday(n,d1); t4.setText(s1); } } public char findyear(int year) { if(year==2001) { return 'A'; } if(year==2002) { return 'B'; } if(year==2003) { return 'C'; } if(year==2004) { return 'K'; } if(year==2005) { return 'F'; } if(year==2006) { return 'G'; } if(year==2007) { return 'A'; } if(year==2008) { return 'I'; } if(year==2009) { return 'D'; } if(year==2010) { return 'E'; } if(year==2011) { return 'F'; } if(year==2012) { return 'N'; } if(year==2013) { return 'B'; } if(year==2014) { return 'C'; } if(year==2015) { return 'D'; } if(year==2016) { return 'L'; } if(year==2017) { return 'G'; } if(year==2018) { return 'A'; } if(year==2019) { return 'B'; } if(year==2020) { return 'J'; } if(year==2021) { return 'E'; } if(year==2022) { return 'F'; } if(year==2023) { return 'G'; } if(year==2024) { return 'H'; } if(year==2025) { return 'C'; } if(year==2026) { return 'D'; } if(year==2027) { return 'E'; } if(year==2028) { return 'M'; } if(year==2029) { return 'A'; } if(year==2030) { return 'B'; } if(year==2031) { return 'C'; } if(year==2032) { return 'K'; } if(year==2033) { return 'F'; } if(year==2034) { return 'G'; } if(year==2035) { return 'A'; } if(year==2036) { return 'I'; } if(year==2037) { return 'D'; } if(year==2038) { return 'E'; } if(year==2039) { return 'F'; } if(year==2040) { return 'N'; } if(year==2041) { return 'B'; } if(year==2042) { return 'C'; } if(year==2043) { return 'D'; } if(year==2044) { return 'L'; } if(year==2045) { return 'G'; } if(year==2046) { return 'A'; } if(year==2047) { return 'B'; } if(year==2048) { return 'J'; } if(year==2049) { return 'E'; } if(year==2050) { return 'F'; } if(year==2051) { return 'G'; } if(year==2052) { return 'H'; } if(year==2053) { return 'C'; } if(year==2054) { return 'D'; } if(year==2055) { return 'E'; } if(year==2056) { return 'M'; } if(year==2057) { return 'A'; } if(year==2058) { return 'B'; } if(year==2059) { return 'C'; } if(year==2060) { return 'K'; } if(year==2061) { return 'F'; } if(year==2062) { return 'G'; } if(year==2063) { return 'A'; } if(year==2064) { return 'I'; } if(year==2065) { return 'D'; } if(year==2066) { return 'E'; } if(year==2067) { return 'F'; } if(year==2068) { return 'N'; } if(year==2069) { return 'B'; } if(year==2070) { return 'C'; } if(year==2071) { return 'D'; } if(year==2072) { return 'L'; } if(year==2073) { return 'G'; } if(year==2074) { return 'A'; } if(year==2075) { return 'B'; } if(year==2076) { return 'J'; } if(year==2077) { return 'E'; } if(year==2078) { return 'F'; } if(year==2079) { return 'G'; } if(year==2080) { return 'H'; } if(year==2081) { return 'C'; } if(year==2082) { return 'D'; } if(year==2083) { return 'E'; } if(year==2084) { return 'M'; } if(year==2085) { return 'A'; } if(year==2086) { return 'B'; } if(year==2087) { return 'C'; } if(year==2088) { return 'K'; } if(year==2089) { return 'F'; } if(year==2090) { return 'G'; } if(year==2091) { return 'A'; } if(year==2092) { return 'I'; } if(year==2093) { return 'D'; } if(year==2094) { return 'E'; } if(year==2095) { return 'F'; } if(year==2096) { return 'N'; } if(year==2097) { return 'B'; } if(year==2098) { return 'C'; } if(year==2099) { return 'D'; } if(year==2100) { return 'E'; } return 0; } public int findmoncode(char a,String mon) { if(a=='A') { if(mon.equals("jan")) return 1; if(mon.equals("feb")) return 4; if(mon.equals("mar")) return 4; if(mon.equals("apr")) return 7; if(mon.equals("may")) return 2; if(mon.equals("jun")) return 5; if(mon.equals("jul")) return 7; if(mon.equals("aug")) return 3; if(mon.equals("sep")) return 6; if(mon.equals("oct")) return 1; if(mon.equals("nov")) return 4; if(mon.equals("dec")) return 6; } if(a=='B') { if(mon.equals("jan")) return 2; if(mon.equals("feb")) return 5; if(mon.equals("mar")) return 5; if(mon.equals("apr")) return 1; if(mon.equals("may")) return 3; if(mon.equals("jun")) return 6; if(mon.equals("jul")) return 1; if(mon.equals("aug")) return 4; if(mon.equals("sep")) return 7; if(mon.equals("oct")) return 2; if(mon.equals("nov")) return 5; if(mon.equals("dec")) return 7; } if(a=='C') { if(mon.equals("jan")) return 3; if(mon.equals("feb")) return 6; if(mon.equals("mar")) return 6; if(mon.equals("apr")) return 2; if(mon.equals("may")) return 4; if(mon.equals("jun")) return 7; if(mon.equals("jul")) return 2; if(mon.equals("aug")) return 5; if(mon.equals("sep")) return 1; if(mon.equals("oct")) return 3; if(mon.equals("nov")) return 6; if(mon.equals("dec")) return 1; } if(a=='D') { if(mon.equals("jan")) return 4; if(mon.equals("feb")) return 7; if(mon.equals("mar")) return 7; if(mon.equals("apr")) return 3; if(mon.equals("may")) return 5; if(mon.equals("jun")) return 1; if(mon.equals("jul")) return 3; if(mon.equals("aug")) return 6; if(mon.equals("sep")) return 2; if(mon.equals("oct")) return 4; if(mon.equals("nov")) return 7; if(mon.equals("dec")) return 2; } if(a=='E') { if(mon.equals("jan")) return 5; if(mon.equals("feb")) return 1; if(mon.equals("mar")) return 1; if(mon.equals("apr")) return 4; if(mon.equals("may")) return 6; if(mon.equals("jun")) return 2; if(mon.equals("jul")) return 4; if(mon.equals("aug")) return 7; if(mon.equals("sep")) return 3; if(mon.equals("oct")) return 5; if(mon.equals("nov")) return 1; if(mon.equals("dec")) return 3; } if(a=='F') { if(mon.equals("jan")) return 6; if(mon.equals("feb")) return 2; if(mon.equals("mar")) return 2; if(mon.equals("apr")) return 5; if(mon.equals("may")) return 7; if(mon.equals("jun")) return 3; if(mon.equals("jul")) return 5; if(mon.equals("aug")) return 1; if(mon.equals("sep")) return 4; if(mon.equals("oct")) return 6; if(mon.equals("nov")) return 2; if(mon.equals("dec")) return 4; } if(a=='G') { if(mon.equals("jan")) return 7; if(mon.equals("feb")) return 3; if(mon.equals("mar")) return 3; if(mon.equals("apr")) return 6; if(mon.equals("may")) return 1; if(mon.equals("jun")) return 4; if(mon.equals("jul")) return 6; if(mon.equals("aug")) return 2; if(mon.equals("sep")) return 5; if(mon.equals("oct")) return 7; if(mon.equals("nov")) return 3; if(mon.equals("dec")) return 5; } if(a=='H') { if(mon.equals("jan")) return 1; if(mon.equals("feb")) return 4; if(mon.equals("mar")) return 5; if(mon.equals("apr")) return 1; if(mon.equals("may")) return 3; if(mon.equals("jun")) return 6; if(mon.equals("jul")) return 1; if(mon.equals("aug")) return 4; if(mon.equals("sep")) return 7; if(mon.equals("oct")) return 2; if(mon.equals("nov")) return 5; if(mon.equals("dec")) return 7; } if(a=='I') { if(mon.equals("jan")) return 2; if(mon.equals("feb")) return 5; if(mon.equals("mar")) return 6; if(mon.equals("apr")) return 2; if(mon.equals("may")) return 4; if(mon.equals("jun")) return 7; if(mon.equals("jul")) return 2; if(mon.equals("aug")) return 5; if(mon.equals("sep")) return 1; if(mon.equals("oct")) return 3; if(mon.equals("nov")) return 6; if(mon.equals("dec")) return 1; } if(a=='J') { if(mon.equals("jan")) return 3; if(mon.equals("feb")) return 6; if(mon.equals("mar")) return 7; if(mon.equals("apr")) return 3; if(mon.equals("may")) return 5; if(mon.equals("jun")) return 1; if(mon.equals("jul")) return 3; if(mon.equals("aug")) return 6; if(mon.equals("sep")) return 2; if(mon.equals("oct")) return 4; if(mon.equals("nov")) return 7; if(mon.equals("dec")) return 2; } if(a=='K') { if(mon.equals("jan")) return 4; if(mon.equals("feb")) return 7; if(mon.equals("mar")) return 1; if(mon.equals("apr")) return 4; if(mon.equals("may")) return 6; if(mon.equals("jun")) return 2; if(mon.equals("jul")) return 4; if(mon.equals("aug")) return 7; if(mon.equals("sep")) return 3; if(mon.equals("oct")) return 5; if(mon.equals("nov")) return 1; if(mon.equals("dec")) return 3; } if(a=='L') { if(mon.equals("jan")) return 5; if(mon.equals("feb")) return 1; if(mon.equals("mar")) return 2; if(mon.equals("apr")) return 5; if(mon.equals("may")) return 7; if(mon.equals("jun")) return 3; if(mon.equals("jul")) return 5; if(mon.equals("aug")) return 1; if(mon.equals("sep")) return 4; if(mon.equals("oct")) return 6; if(mon.equals("nov")) return 2; if(mon.equals("dec")) return 4; } if(a=='M') { if(mon.equals("jan")) return 6; if(mon.equals("feb")) return 2; if(mon.equals("mar")) return 3; if(mon.equals("apr")) return 6; if(mon.equals("may")) return 1; if(mon.equals("jun")) return 4; if(mon.equals("jul")) return 6; if(mon.equals("aug")) return 2; if(mon.equals("sep")) return 5; if(mon.equals("oct")) return 7; if(mon.equals("nov")) return 3; if(mon.equals("dec")) return 5; } if(a=='N') { if(mon.equals("jan")) return 7; if(mon.equals("feb")) return 3; if(mon.equals("mar")) return 4; if(mon.equals("apr")) return 7; if(mon.equals("may")) return 2; if(mon.equals("jun")) return 5; if(mon.equals("jul")) return 7; if(mon.equals("aug")) return 3; if(mon.equals("sep")) return 6; if(mon.equals("oct")) return 1; if(mon.equals("nov")) return 4; if(mon.equals("dec")) return 6; } return 0; } public void paint(Graphics g) { g.drawString("BY KIRAN.M",245,275);Color cl=new Color(240,210,10);setForeground(Color.blue); ;} public void findday(int n,int date) { if(n==1) { if(date==1 || date==8||date==15 || date==22 ||date==29) { s1="monday"; } if(date==2 || date==9||date==16 || date==23 ||date==30) { s1="tuesday"; } if(date==3 || date==10||date==17 || date==24 ||date==31) { s1="wednesday"; } if(date==4 || date==11||date==18 || date==25 ) { s1="thursday"; } if(date==5 || date==12||date==19 || date==26 ) { s1="friday"; } if(date==6 || date==13||date==20 || date==27 ) { s1="saturday"; } if(date==7 || date==14 || date==21 || date==28 ) { s1="sunday"; } } if(n==2) { if(date==1 || date==8||date==15 || date==22 ||date==29) { s1="tuesday"; } if(date==2 || date==9||date==16 || date==23 ||date==30) { s1="wednesday"; } if(date==3 || date==10||date==17 || date==24 ||date==31) { s1="thursday"; } if(date==4 || date==11||date==18 || date==25 ) { s1="friday"; } if(date==5 || date==12||date==19 || date==26 ) { s1="saturday"; } if(date==6 || date==13||date==20 || date==27 ) { s1="sunday"; } if(date==7 || date==14 || date==21 || date==28 ) { s1="monday"; } } if(n==3) { if(date==1 || date==8||date==15 || date==22 ||date==29) { s1="wednesday"; } if(date==2 || date==9||date==16 || date==23 ||date==30) { s1="thursday"; } if(date==3 || date==10||date==17 || date==24 ||date==31) { s1="friday"; } if(date==4 || date==11||date==18 || date==25 ) { s1="saturday"; } if(date==5 || date==12||date==19 || date==26 ) { s1="sunday"; } if(date==6 || date==13||date==20 || date==27 ) { s1="monday"; } if(date==7 || date==14 || date==21 || date==28 ) { s1="tuesday"; } } if(n==4) { if(date==1 || date==8||date==15 || date==22 ||date==29) { s1="thursday"; } if(date==2 || date==9||date==16 || date==23 ||date==30) { s1="friday"; } if(date==3 || date==10||date==17 || date==24 ||date==31) { s1="saturday"; } if(date==4 || date==11||date==18 || date==25 ) { s1="sunday"; } if(date==5 || date==12||date==19 || date==26 ) { s1="monday"; } if(date==6 || date==13||date==20 || date==27 ) { s1="tuesday"; } if(date==7 || date==14 || date==21 || date==28 ) { s1="wednesday"; } } if(n==5) { if(date==1 || date==8||date==15 || date==22 ||date==29) { s1="friday"; } if(date==2 || date==9||date==16 || date==23 ||date==30) { s1="saturday"; } if(date==3 || date==10||date==17 || date==24 ||date==31) { s1="sunday"; } if(date==4 || date==11||date==18 || date==25 ) { s1="monday"; } if(date==5 || date==12||date==19 || date==26 ) { s1="tuesday"; } if(date==6 || date==13||date==20 || date==27 ) { s1="wednesday"; } if(date==7 || date==14 || date==21 || date==28 ) { s1="thursday"; } } if(n==6) { if(date==1 || date==8||date==15 || date==22 ||date==29) { s1="saturday"; } if(date==2 || date==9||date==16 || date==23 ||date==30) { s1="sunday"; } if(date==3 || date==10||date==17 || date==24 ||date==31) { s1="monday"; } if(date==4 || date==11||date==18 || date==25 ) { s1="tuesday"; } if(date==5 || date==12||date==19 || date==26 ) { s1="wednesday"; } if(date==6 || date==13||date==20 || date==27 ) { s1="thursday"; } if(date==7 || date==14 || date==21 || date==28 ) { s1="friday"; } } if(n==7) { if(date==1 || date==8||date==15 || date==22 ||date==29) { s1="sunday"; } if(date==2 || date==9||date==16 || date==23 ||date==30) { s1="monday"; } if(date==3 || date==10||date==17 || date==24 ||date==31) { s1="tuesday"; } if(date==4 || date==11||date==18 || date==25 ) { s1="wednesday"; } if(date==5 || date==12||date==19 || date==26 ) { s1="thursday"; } if(date==6 || date==13||date==20 || date==27 ) { s1="friday"; } if(date==7 || date==14 || date==21 || date==28 ) { s1="saturday"; } } } }

Related Source Codes

Script Name Author
Sending mail Using JavaMail to Yahoo and Gmail accounts sai prasad
Simple Program in Java to Implement Multithreading Satish.K
Simple Calculator in Java Using Remote Method Invocation Satish.K
Guest Book Application Using Servlets Satish.K
String Manipulation Using Stringification Satish.K
String Manipulation Using Stringification Satish.K
Moving Ball Application Using Java Beans Satish.K
Rapid Roll game subrahmanyeswararao
student mgm arpan
Sourav Datta
Download Manager Sagar
Address Book in Java Rahul Chouhan
address book using java database connectivity(jdbc-msaccess) shekhar bansal
sun Steganography B.Rajavel
Connecting Java with MS-Access - Inserting data in Aseem

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=546


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review