Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+15 votes
asked in CSC211_Winter2018 by (1 point)

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 (3.4k 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 (1 point)
...