私は持っていJTextField
ます。同じJTextField
ことがユーザーの名前とパスワードの両方を取得するために使用されます。したがって、ユーザー名を取得している場合は、ユーザーが入力している内容を[テキスト]フィールドに表示します。ただし、彼がパスワードを挿入している場合、フィールドにはパスワードを表示しないでください(代わりに*文字を表示してください)。
JTextFieldに入力した文字を非表示にするにはどうすればよいですか?
擬似コード:
If (usernameBool!=true) {
// Display normal text - user is able to see the password
} else {
// This is going to be a password field, so i need to not show the password to the user instead show it as ******* instead.
}
JPasswordField
注:これには使用したくない