🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #18782

Re: HELP!!! Textfield Madness

#18782
From: Howard Weiner
Date: Mon, 27 Apr 1998 00:00
21 lines
1312 bytes
One possible solution is to add a TextListener to the field which creates an
instance of a delegation class with the textValueChanged method. The
textValueChanged method is invoked automatically for each new character
entered into the corresponding text field.

During each invocation of the textValueChanged method, do a getText() on the
field, count the characters, and at five block further data entry--along
with a beep from the Toolkit, perhaps.

Hope this helps.

HDW
Adam Silverthorne wrote in message <3544C34B.7324BAC@slip.net>...
>How does one stop text from continuing past a certain point in a text
>field?  I only want the user to be able to enter up to five characters,
>but textfields let users enter as many as they want, even if you
>setColumns(5).
>
>ideas greatly appreciated!
>
Technical Details
Message-ID: <6i2lkr$8b712@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3544C34B.7324BAC@slip.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,9a9b6fafce522320
X-Google-Attributes: gidf74b3,public
From: "Howard Weiner" <HDWeiner@erols.com>
Subject: Re: HELP!!! Textfield Madness
Date: 1998/04/27
Message-ID: <6i2lkr$8b712@forums.borland.com>
X-Deja-AN: 348186593
References: <3544C34B.7324BAC@slip.net>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.language