wood burning stoves
The moose likes Beginning Java and the fly likes Need help with one piece of code. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need help with one piece of code." Watch "Need help with one piece of code." New topic

Need help with one piece of code.

Mack Grill

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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14991

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 8 API documentation
I agree. Here's the link: http://aspose.com/file-tools
subject: Need help with one piece of code.
jQuery in Action, 3rd edition