Is this the same problem:
Need help understanding random loops. code inside (Beginning Java forum at JavaRanch)
Type: Posts; User: Norm
Is this the same problem:
Need help understanding random loops. code inside (Beginning Java forum at JavaRanch)
That is NOT the way to do it!!!
You code will never show image3 .
Look back at post #8. You need a flag (a boolean variable for example) that you set when the image is the bent tree and that you can use in the paint method to control the drawing of the text.
Very...
If you want to understand what your code is doing when it executes, you must debug it.
One way is using an interactive debugger that is part of some IDEs.
Another way is to use the println...
Use an interactive debugger so you can see what the code is doing. You must see what the code is doing if you are going to be able to fix it. printlns are the most common way to do it.
If you don't...
Here is a sample:
System.out.println("var=" + var);
Replace var with any variable you want to print out the value of.
Please explain.
Add a println statement immediately following the call to random() that prints out the value of rand.
execute the program several times and see what number is printed out. Is it...
When you set action to the third image, you need a way to tell the paint method that the text is to be displayed. When action is set to the other images, you should tell paint not to display the...
You call the getImage() method in 4 places. The first place you call it you save what it returns in the action variable. For the other 3 places you ignore what getImage() returns. Try assigning...
Can you post the code that displays the image?
This code won't show any image:
import java.applet.Applet;
import java. awt.*;
public class MyPictures extends Applet {
Image action;
Cross posted at: Need help making 3 images become random. code inside - Dev Shed
Does this code show an image when it is executed?