Learning Java, how to type text on canvas?
<p>I'm reading a book by Eric Roberts - Art and science of java and it got an excersise that I can't figure out - </p>

<p>You have to make calendar, with GRect's, 7 by 6, that goes ok, the code part is easy, but also you have to type the numbers of the date on those rectangles, and it's kinda hard for me, there is nothing about it in the book.</p>

<p>I tried using GLabel thing, but here arises the problem that I need to work on those numbers, and it says "can't convert from int to string and vice versa". 
GLabel (string, posX, posY) - it is not accepting int as a parameter, only string, I even tried typecasting, still not working.</p>

<p>For example I want to make a loop</p>

<p>int currentDate = 1;</p>

<p>while (currentDate &lt; 31) {</p>

<p>add(new Glabel(currentDate, 100, 100);</p>

<p>currentDate++;</p>

<p>This code is saying that no man, can't convert int to string.
If i try changing currentDate to string, it works, but I got a problem with calculation, as I can't manipulate with number in string, it doesn't even allow to typecast it into int.</p>

<p>How can I fix it? Maybe there is another class or method to type the text over those rectangles?</p>

<p>I know about println but it doen't have any x or y coordinates, so I can't work with it. And I think it's only for console programs.</p>
