• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help with one piece of code.

 
Mack Grill
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic