How can I do it if the component has focus? 

> _____________________________________________
> Lenny Reynshteyn
Firmwide Internet Group 
Goldman, Sachs & Co.
> Tel: (212) 855-0332
> Email: [EMAIL PROTECTED] 
> 


-----Original Message-----
From: Dmitry Beransky [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 1:30 PM
To: [EMAIL PROTECTED]
Subject: Re: highlighting text in TextField


The default implementation of the Caret shows highlighting only when the 
corresponding component has focus.  If you want the highlighting effect on 
an unfocused component your options are: 1) writing your own Caret; 2) fake 
the highlighting by playing with the background/foreground colors.

Dmitry

At 10:16 AM 3/12/2001, Reynshteyn, Leonid wrote:
>Can someone suggest the simplest way to programmatically highlight text in
>JTextField?
>
>selectAll() highlights the text internally but does not display the text
>highlighted. I want it to appear as if it's been highlighted with a mouse.

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to