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
Yes use JFromattedTextFeild with a MaskFormatter class. MaskFormatter
has a setPlaceholderCharacter('_')
function to help you with. You may also need to use the InputVerifier to verify user input's validity. JFormattedTextFeild's documentation has example to show how to use an InputVerifier
with it.