Clearing a TextField

View: New views
2 Messages — Rating Filter:   Alert me  

Clearing a TextField

by whirledpeas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,



I am new to this Forum. I've been using Netbeans 6.5 for a few months now, and I like it. But I am trying to figure out how to clear a textfield when someone clicks a button.



I tried setText(""); setValue(""); setText(null); setValue(null); in the button

callback, but none seem to work except for the very first time.

Seems like this would be very easy to accomplish, but it seems to

ignore my attempts to clear it.



Thanks.





Re: Clearing a TextField

by Ernie Rael :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This list is for discussion and planning of NetBeans IDE itself, not using NB. See http://www.netbeans.org/community/lists/top.html
nbusers@...
The NetBeans users mailing list. General discussion of NetBeans use, this is the place to ask for help and to help others.
Recommended for : General support and discussion, for NetBeans users of all levels.
Though this question sounds like a basic java/swing issue, not a NetBeans issue, and a basic java forum may be most appropriate.

-ernie

On 10/22/2009 8:05 PM, whirledpeas wrote:
Hi all,



I am new to this Forum. I've been using Netbeans 6.5 for a few months now, and I like it. But I am trying to figure out how to clear a textfield when someone clicks a button.



I tried setText(""); setValue(""); setText(null); setValue(null); in the button

callback, but none seem to work except for the very first time.

Seems like this would be very easy to accomplish, but it seems to

ignore my attempts to clear it.



Thanks.