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

Reply via email to