CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2000
    Location
    India (Gujarat)
    Posts
    12

    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.




  2. #2
    Guest

    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


  3. #3
    Join Date
    May 2000
    Location
    AP,INDIA
    Posts
    13

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured