Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

  1. Re: Threading problem? - hopefully in the correct forum this time

    Now you need to do some thinking on how to do all the characters.

    Why are you working on Morse code? I did a project for Morse code about 10 years ago.
    I put one version on a website:
    Morse...
  2. Re: Threading problem? - hopefully in the correct forum this time

    You need to wrap the call to the sleep() method in a try/catch block. The catch must be for the exception that sleep() can throw.
  3. Re: Threading problem? - hopefully in the correct forum this time

    Have you read my earlier posts? eg #12 & #14
    Did you read the API doc for the sleep() method to see what exception it can throw?
    Why are you catching the RuntimeException?
  4. Re: Threading problem? - hopefully in the correct forum this time

    What happens when you call sleep() between the calls to play()?
  5. Re: Threading problem? - hopefully in the correct forum this time

    Look at the API doc for the sleep() method. It gives the name of the exception.
  6. Re: Threading problem? - hopefully in the correct forum this time

    Sorry, I don't use that IDE and don't know about its error messages. What error do you get when you try to compile the code with the javac command?

    Why does the code catch the RuntimeException?...
  7. Re: Threading problem? - hopefully in the correct forum this time

    Are you sure you are executing the code that is posted? The stack trace has to print BEFORE "caught" is printed.
  8. Re: Threading problem? - hopefully in the correct forum this time

    Put:
    e.printStackTrace();
    in the catch block to see what exception is being thrown.
  9. Re: Threading problem? - hopefully in the correct forum this time

    Put that code in a try/catch block
  10. Re: Threading problem? - hopefully in the correct forum this time

    Try putting a call to the Thread sleep() method between the calls to play().
  11. Re: Threading problem? - hopefully in the correct forum this time

    Please change the code tags. The ending should use / not \
    Edit your post and wrap your code with


    <YOUR CODE HERE>

    to get highlighting and preserve formatting.
Results 1 to 11 of 11