setting maximum length for TextField
I want to have the length of the input value in the textfield to be limited. But the displayed length of textfield may be more.
This feature is available in html forms wherein you can easily specify Maxlength and minLength also.
I want the same with applets. i tried setbounds() method but it is to resize and move the field.
Thanks for your help.
Re: setting maximum length for TextField
HI,
As far as I know, there is no method to set the length property in the TextField. This is a feature(bug) in TextField. one method of achieving this is to write a listener which is called whenever a char is entered and process the length. this is nothing but implementing the Length property by yourself.
Kalyan
Re: setting maximum length for TextField
hello,
it is better to use java.awt.event.KeyEvent.conume() to stop entry
into textfield after some length();
have good programming
k_venkurao