Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    The PlaySound class has it.

    Where did you copy the code from? It was not written to do what you want. It should be rewritten for you to be able to use it as you are trying.

    Take the code out...
  2. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    In the PlaySound class, is there a variable/reference to the inner class that has the run() method?
    Is it public? Can you use it from another class?

    Think about what this statement does and how...
  3. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    run this=Bluemoon.PlaySound$1@1d23e75
    The full class name is Bluemoon.PlaySound$1
    The $1 is for the inner class that run is in.
    If run were in the PlaySound class, the output would be something...
  4. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    I don't think so. Post the print out here and I'll show you.
  5. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    I don't think so. Post the print out here and I'll show you.
  6. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    Did you add the println and look at the output?

    The print out will show you what class run() is in.
  7. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    The code that you posted for the class: PlaySound compiles and executes on my system and plays a sound.
  8. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    The code you posted compiles and executes on my system.
    Did you try to compile and execute what was posted in post #1?

    Compile and execute the class: PlaySound that was posted in post#1.
  9. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    that is not a constructor. It's a method.
    Add this line first thing in the run method:
    System.out.println("run this="+ this);
    And look what is printed out when it executes.
    Now look in the folder...
  10. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    Are you sure run() is a method in the PlaySound class?

    If you have changed the class from your earlier posting, please post a new copy of the PlaySound class.
  11. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    Where is the run() method defined?
    What class is it in?
  12. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    That code will not compile. If I can't compile it I can't test it.
  13. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    Right, don't post all of that. Make a very short test program to post.
  14. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    Where is the run() method defined?
    I copied, compiled and executed your code with no problem.

    There is no s.run() in the code you posted???

    You should post the code you are having problems...
  15. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    Please post the full text of the error message.
  16. Replies
    32
    Views
    3,797

    Re: Adding sound to program.

    Can you explain what happens or does not happen?
Results 1 to 16 of 16