Help with Java. Complete Newbie

austin316

Diamond Member
Dec 1, 2001
3,572
0
0
Ok, heres the problem. I need to have the user enter in their name in the format "last name, first name". I must check the data to ensure that two words were typed, along with a comma and then a space inbetween them. How do I go about doing this?
 

BigJ

Lifer
Nov 18, 2001
21,330
1
81
JOptionPane is your friend. Look in the Java docs for information on how to use it. Then, you can use any of several String methods (substring(), charAt(), indexOf()) depending on how you handle it.