How to get textfield that updates from listener in Java Swing for Hangman game?

后端 未结 3 1146
囚心锁ツ
囚心锁ツ 2021-01-29 06:49

I am trying to write a code from Hangman program. I am not sure if this idea is correct. I was thinking of having dashes (_ _ _ _ _) in textfield which must dynamically change w

3条回答
  •  梦谈多话
    2021-01-29 06:58

    I wouldn't recommend text field with dashes, but you can do it like that. Give it a try, see how it looks and then create something better :-) You can, for example, use panels or labels with images, stylized buttons, or just large labels with a character each. Draw a picture of what you would like your game to look like, and then start coding. It's design before code :-)

提交回复
热议问题