Search:

Type: Posts; User: Norm

Search: Search took 0.16 seconds.

  1. Re: Trying to make 3 images become random in an Applet. Need help

    Is this the same problem:
    Need help understanding random loops. code inside (Beginning Java forum at JavaRanch)
  2. Re: Trying to make 3 images become random in an Applet. Need help

    That is NOT the way to do it!!!

    You code will never show image3 .
  3. Re: Trying to make 3 images become random in an Applet. Need help

    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...
  4. Re: Trying to make 3 images become random in an Applet. Need help

    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...
  5. Re: Trying to make 3 images become random in an Applet. Need help

    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...
  6. Re: Trying to make 3 images become random in an Applet. Need help

    Here is a sample:
    System.out.println("var=" + var);
    Replace var with any variable you want to print out the value of.
  7. Re: Trying to make 3 images become random in an Applet. Need help

    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...
  8. Re: Trying to make 3 images become random in an Applet. Need help

    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...
  9. Re: Trying to make 3 images become random in an Applet. Need help

    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...
  10. Re: Trying to make 3 images become random in an Applet. Need help

    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;
  11. Re: Trying to make 3 images become random in an Applet. Need help

    Cross posted at: Need help making 3 images become random. code inside - Dev Shed

    Does this code show an image when it is executed?
Results 1 to 11 of 11