🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: aus.computers.java
2 messages
2 total messages Started by Trembath Sun, 19 Mar 2000 00:00
AWT Text fields
#925
Author: Trembath
Date: Sun, 19 Mar 2000 00:00
16 lines
1082 bytes
When switching focus to a text field, be it by the user, or the program, 
how do you make it select all the text?

ie. like when you click on the address bar in netscape, by default all 
the text is selected, so you can just start typing and it will replace 
everything that is there.

I've got a little applet where im constantly tab'ing back over fields to 
replace their contents, and i have to delete the values manualy each 
time...quite frustrating after a while.

Any ideas?

TIA

-Daniel
Re: AWT Text fields
#928
Author: Cannon
Date: Mon, 20 Mar 2000 00:00
24 lines
1536 bytes
TextField tf = new TextField();
tf.setText("blah");
//Select to be placed in the focus handler
tf.selectAll();


Trembath <danielt@ihug.com.au> wrote in message
news:danielt-60C06E.15005919032000@news.mel.ihug.com.au...
> When switching focus to a text field, be it by the user, or the program,
> how do you make it select all the text?
>
> ie. like when you click on the address bar in netscape, by default all
> the text is selected, so you can just start typing and it will replace
> everything that is there.
>
> I've got a little applet where im constantly tab'ing back over fields to
> replace their contents, and i have to delete the values manualy each
> time...quite frustrating after a while.
>
> Any ideas?
>
> TIA
>
> -Daniel
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads