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...
Type: Posts; User: Norm
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...
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.
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?
What happens when you call sleep() between the calls to play()?
Look at the API doc for the sleep() method. It gives the name of the exception.
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?...
Are you sure you are executing the code that is posted? The stack trace has to print BEFORE "caught" is printed.
Put:
e.printStackTrace();
in the catch block to see what exception is being thrown.
Put that code in a try/catch block
Try putting a call to the Thread sleep() method between the calls to play().
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.