I'm learning about inheritance and on this problem I first have to create a class where I get/set methods and get user input for the data fields.
I suppose I should know it at this point but I don't know how to get the users name when they input it. I copied the whole code but
the issue is at line 51.
I'm no Swing expert but I think JOptionPane.ShowInputDialog() returns a String. Your "customerNameString" variable will contain whatever String the user entered. What do you need to parse from the input?
There is more about option panes in the Java Tutorials.
SW is right: if you enter Ryan Bishop in the option pane it will return Ryan Bishop as a String.
Don't write new String(...). Simply write.
String name = JOptionPane.showInputDialog(...);
Of course there is something else. You are not using the String for anything. I presume that is the next stage?
Why are you using option panes? That is very old‑fashioned programming. Find out about Scanner.
Thanks for the replies. A little while later I realized I didn't have to parse it.
I'm not sure why I'm using joptionpane but I'm not sure about anything I do with java. The book I'm using just says to get "get user input" but in the chapter shows examples with joptionpane. I'm thinking I may just change it to scanner.
Just out of curiosity, why is it old fashioned? Is scanner more efficient in some way?