I have put this together for my calendar program....but when I javac I get 'cannot resolve symbol' error for the i in this line: days = new Day( i + 1, 4, 2002);(there is an i enclosed in brackets after the word days but for some reason doesn't appear when I preview this message)
here is the portion of code it appears with:
Day[] days = new Day[30]; days = new Day( i + 1, 4, 2002); g.drawString("1", 150, 250); int x = 100; int y = 50; for(int i = 0; i < 30; i++){ days .draw( g, x, y); x += 100; if( x >= 700 ){ x = 0; y +=100; }
It appears you are using the variable i before it is declared. What you probably want to do is declare and initialize it at some point before the first line of code you are showing. When you do that, you can also change your for loop to initialize i, but not declare i.
The reason [i] in square brackets doesn't appear is that this forum uses that to indicate italics. You will notice that right after you mentioned where the i with brackets is, everthing was italicized. See the bottom of this page (and the posting page) where it says Formatting Your Post (which maybe should be in bright red, blinking animated text that flies all over the top of the page, like those annoying Yahoo ads); there it tells you about the different tokens that can be used to mark up your forum post. Incidentally, your posts will look really nice if you use the java tag on your code snippets.
Oops - the Formatting Your Post information isn't at the bottom of the message viewing page, only on the "Post a Reply" or "Post a New Message" pages. So, when you are posting a message, scroll down to the bottom of the page and check it out, or look here: http://www.artima.com/forums/howtopost.html