特定の数の文字が入力されたときに関数を実行するために使用できるリスナーは何JTextField
ですか?
JTextField txtF=new JTextField();
char[] txtIn=txtF.getText().toCharArray();
if(txtIn.length()==5){
//perform action here
}
試しkeyPressed
てみましたが、文字の長さを確認するためにEnterキーを押す必要があります。
特定の数の文字が入力されたときに関数を実行するために使用できるリスナーは何JTextField
ですか?
JTextField txtF=new JTextField();
char[] txtIn=txtF.getText().toCharArray();
if(txtIn.length()==5){
//perform action here
}
試しkeyPressed
てみましたが、文字の長さを確認するためにEnterキーを押す必要があります。