Getting show dialog box to generate properly
Hi, I have a feeling I'm gonna feel pretty dumb when someone helps me with this. I'm really really new and am probably over my head with this stuff but my determination to learn is relentless. I have get the user to type in their phone number in the dialog box and show their number in this format nnn nnn nnnn with spaces but i should assume whenever they type it in that it will be written like so: nnn-nnn-nnnn. Everytime I try I get thrown this exception
Exception in thread "main" java.lang.NumberFormatException: For input string: "nnn-nnn-nnnn"
at sun.misc.FloatingDecimal.readJavaFormatString(Floa tingDecimal.java:1224)
at Chapter3Question66.main(Chapter3Question66.java:16 )
any help would be greatly appreciated.
p.s. here is a copy of what i've written:
/* Chapter 3 Question 66
* V. H.
public class Chapter3Question66
public static void main( String  args)
String input = JOptionPane.showInputDialog( null, "Please enter your telephone number" );
Double number = Double.parseDouble( input );
JOptionPane.showMessageDialog( null, " Your telephone number is " + number );