Open joeabirizk opened 9 years ago
You can use a code similar to this within a keyTyped event:
if(jTextField1.getText().length()>=2){ evt.consume(); }
how to make values between two numbers
what do you mean? for example how to restrict the input between 5 and 10 on a text field?
yes !
yesDate: Mon, 29 Dec 2014 05:09:18 -0800 From: notifications@github.com To: ift215@noreply.github.com CC: joerizik@hotmail.com Subject: Re: [ift215] @ digits (#1)
what do you mean? for example how to restrict the input between 5 and 10 on a text field?
— Reply to this email directly or view it on GitHub.
=
int value = Integer.parseInt(jTextField1.getText().trim());
if((value>5)&&(value<10)){
//do this
}else{
//do that
}
okay thank you
I gave you a part of the solution, try to integrate it correctly within your code
how to put 2 digits number in a text field