Rewrite the guessing game in Swing