I'm trying to write a program, so when a user enters their name a specific message is displayed. However, it's been a while since I used Java and eclipse, so I'm not sure what I'm doing wrong, or what I need to do.
There is something very wrong about your booleans; that on line 9 can only be true false if somebody clicked the cancel button on your option pane, and that on line 11 can never be false. Why re you using option pane? That is very old‑fashioned style.
You need to tell us what is going wrong and what you expected to happen. What does the show message dialogue method return? Can you assign that to a String?
[Edit]Sorry, got a true when I should have said false.
Campbell, thanks for replying. I am getting the error message "Type mismatch: cannot convert from void to String" for lines 12 and 14. As for line 9, eclipse prompted me to change to a Boolean from what I originally had, which was String n1=s1. I didn't know that option pane was old-fashioned.
OK, so I was told that message boxes are out. So I used a different input, but it's not running right? No matter who's name I put in, it skips to the part about Star Wars and doesn't run anything else. Can someone see what I'm doing wrong?