| Author |
Need help with one piece of code.
|
Mack Grill
Greenhorn
Joined: Feb 27, 2012
Posts: 29
|
|
I'm making an applet that randomly displays three images with a string of text on one of the images.
The problem I'm having is trying to get the string of text just to appear on a specific image.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12952
|
|
I see a few problems:
In line 12 you are creating a new local variable called message that isn't used. You probably wanted to set the member variable declared in line 6 to some message. If that's the case, change line 12 to:
Without the type String in front of it, because that means you're declaring a new variable instead of setting the existing member variable.
In line 21 you're drawing the empty string "". You probably meant to draw the message there instead:
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Need help with one piece of code.
|
|
|