Results 1 to 6 of 6

Thread: Calendar-Dairy-Events

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271

    Question Calendar-Dairy-Events

    Hi,

    I am new to Java and I have been set a project to produce a calender that can store information for each day, this information will be:

    * Event Type (integer)
    * Event Name (String)
    * Event Time (String)

    I will have this information gained from a database, all I need to know is how to create the calender.

    I would also like, depending on the 'Event Type' to display an icon which relates to the event, ie For a Birthday a cake is shown...

    if some has a program that does this, could I have it? or if someone code write one for me, I would be much grateful.

    Its will not be used for comercial use, but for coursework on a course I am doing.

    This is the only thing I'm having problems with.

    So thank you in advanced...
    §tudz

    Studzworld.com - Portfolio

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    What is your question/request? That we write the app for you?

    Nobody has a complete program that will exactly fit your requirements and nobody will do your job. You're supposed to learn the language, so learn it by doing it.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271
    Thanks but…

    I was asking if any one was able to help me, by showing me their code for it, or directing me to a tutorial....

    But it doesn't matter now as I have spent hours trying and finally come up with the goods myself....

    This is was a massive task, and a stupid task to be set as an assignment for students who have never looked at Java before.

    So your arrogance is of no help… This is a good forum, and I have been a member for ages, and enjoy using the Forums, I am a VB programmer primarily but have had to convert to java for this assignment.
    I have found the help given in the VB forums and VB. Net forums invaluable.

    I would just like to say that you should be encouraging newbies to the language, by helping them, as there is very literature available on the web, not slating them.
    As what you have said
    You're supposed to learn the language, so learn it by doing it.
    You tell me here to learn how to do it myself?
    Without any prior knowledge of java or how to get started…
    Is this not like telling a person to light fire, without matches, and no wood around for miles?

    Well…

    Any constructive help in the mean time, would be appreciated.

    Thank you.
    §tudz

    Studzworld.com - Portfolio

  4. #4
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Posted by §tudz

    I was asking if any one was able to help me, by showing me their code for it, or directing me to a tutorial....
    Posted by §tudz

    if some has a program that does this, could I have it? or if someone code write one for me, I would be much grateful.
    §tudz you did say that you wanted someone to code an application for you.

    CornedBee could have used a better choice of words though.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I could have, you're right. I'm sorry. Was pretty tired when I wrote this, and slightly pissed off because I already had some "write an app for me" requests that day.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271
    What I ment by has any one got a program that does this and could I have it... was I just wanted to see how they did it, I'm not into copying or ripping off others programs...

    sorry about the misted clarity,
    well,

    any way.

    can any one help.
    I did work out how to do it but my version only works for the current month. here is my code for it:

    Code:
    int DayNo = now.getDate();
        int DayVal = now.getDay();
        int Row = 0;
        int Col = 0;
        
        if (DayNo == 7){
        Row = 0;
        }
        else{
            Row = DayNo / 7;
        }
        
        // Fill in Today
        switch(DayVal) {
         case 1: tbl_Days.setValueAt(Integer.toString(DayNo),Row,1); break;
         case 2: tbl_Days.setValueAt(Integer.toString(DayNo),Row,2); break;   
         case 3: tbl_Days.setValueAt(Integer.toString(DayNo),Row,3); break; 
         case 4: tbl_Days.setValueAt(Integer.toString(DayNo),Row,4); break;
         case 5: tbl_Days.setValueAt(Integer.toString(DayNo),Row,5); break;
         case 6: tbl_Days.setValueAt(Integer.toString(DayNo),Row,6); break;
         case 7: tbl_Days.setValueAt(Integer.toString(DayNo),Row,0); break;
       }
        
        // Fill in Days goneby...
        while (DayNo > 1) {
            DayNo = DayNo - 1;
            DayVal = DayVal - 1;
            switch(DayVal) {
                case 0: Col = 0; break;
                case 1: Col = 1; break;
                case 2: Col = 2; break;
                case 3: Col = 3; break;
                case 4: Col = 4; break;
                case 5: Col = 5; break;
                case 6: Col = 6; break;
            }     
            tbl_Days.setValueAt(Integer.toString(DayNo),Row,Col); 
    
            if (DayVal == 0) {
            Row = Row - 1;
            DayVal = 7;
            }
         } 
        
        // Fill in Days to come...
        Row = 4;
        DayNo = now.getDate();
        DayVal = now.getDay();
        while (DayNo < DaysInMonth[(now.getMonth())]) {
            Col = Col + 1;
            if (Col == 7) {
                Col = 0;
                Row = Row + 1;
                DayNo = DayNo + 1;
                DayVal = DayVal + 1;
                if (DayVal == 6){
                    DayVal = 0;
                }
                else {
                    DayVal = DayVal + 1;
                    }
                switch(DayVal) {
                    case 0: Col = 0; break;
                    case 1: Col = 1; break;
                    case 2: Col = 2; break;
                    case 3: Col = 3; break;
                    case 4: Col = 4; break;
                    case 5: Col = 5; break;
                    case 6: Col = 6; break;
                }    
                tbl_Days.setValueAt(Integer.toString(DayNo),Row,Col);   
            }
            else {
                DayNo = DayNo + 1;
                if (DayVal == 6){
                    DayVal = 0;
                }
                else {
                    DayVal = DayVal + 1;
                }
                switch(DayVal) {
                    case 0: Col = 0; break;
                    case 1: Col = 1; break;
                    case 2: Col = 2; break;
                    case 3: Col = 3; break;
                    case 4: Col = 4; break;
                    case 5: Col = 5; break;
                    case 6: Col = 6; break;
               }    
               tbl_Days.setValueAt(Integer.toString(DayNo),Row,Col); 
           } 
          }

    this is currently behind a button.

    I have used
    java.util.date;

    I know you can use the gregorian calender class, but I have no idea how to do this...


    any help with this? thanks
    §tudz

    Studzworld.com - Portfolio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width