Originally Posted by Fou-Lu
Ultimately the problem is that you've overwritten the actualWord with that of the guessed word after the first guess action.
Within actionPerformed, you want to split it up logically into what its source is first. So branch for each statement available. You currently have a check for guess and restart, but not for initialize (the okay button). So all the work the okay button would be doing executes every time an event handle is passed to the actionPerformed. This has an assignment of
actualWord = wordField.getText();, so after your first guess you then end up with the actualWord being that of the replaced first guess (so if my word is test and I guess 't', than I'd have actualWord being t**t). Group all that logic into the okay branch.
Does that mean that if the code is not within one of my sources(
) that anytime any source is used, all of the code that is not in any source brackets will also be executed?