Java Eclipse - Placing a space between my JOptionPane.showMessageDialog? -


i'm messing around in eclipse (beginner) , have gui made produce final output of, "your name john smith doe". however, when outputs final name, reads this, "your name johnsmithdoe". there no spacing between first, middle, , last name. how can add spacing between names? code below.

thank you,

don

string fn = joptionpane.showinputdialog("please enter name"); string mn = joptionpane.showinputdialog("please enter middle name"); string ln = joptionpane.showinputdialog("please enter last name");  string name = fn + mn + ln;  joptionpane.showmessagedialog(null, "your name " + name, "name", joptionpane.plain_message); 

you need include space characters in string: string name = fn + " " + mn + " " + ln;


Comments

Popular posts from this blog

rdbms - what exactly the undo information lives in oracle? -

bash - How do you programmatically add a bats test? -

java - Getting exception in JDBC thin driver -