Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Hmmm... ??

 
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
 
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.
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic