• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hmmm... ??  RSS feed

 
Jon Brasted
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My code... (by a Java n00b )

and the error I get is...
App_SimpCntdwn.java:31: cannot resolve symbol
symbol : method drawString (int,int,int)
location: class java.awt.Graphics
g.drawString(countdown, 5, 20 + y); // this hopefully allows for a line space
^

Many thanks,
Jon
 
Carlos Failde
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method drawString is for drawing strings funnily enough. But you've not supplied it with a String, just three ints.
You can use String.valueOf(int i) to make a string out of an int. But my preferred way is to just concatenate the int to an empty string - viola instant string.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!