Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+15 votes
asked in CSC211_Winter2018 by (817 points)

2 Answers

+10 votes
 
Best answer

Try this:

int num = 42;
g.drawString("" + num, 100, 200);

Alternatively:

g.drawString(Integer.toString(num), 100, 200);
answered by (17.9k points)
selected by
+8 votes

what do you mean int value in the drawing panel? The drawing panel is a class that you call in order to use graphics. The only way to print out numbers are to you use g.drawString because that is from the panel class.

answered by (8 points)
...