I have another problem with highlighting in a textcomponent( a JTextPane)

I catch the caretupdate event to select parts of my text when the user
selects a character (the text contains of collections of characters instead
of separate characters... So if a character is selected i want to select all
the characters in the collection of the selected character.)
The problem is that i can get it to work with the mouse, but not with the
arrows on the keyboard. The background selection color with the arrows turns
white instead of the blue i set it to (with setSelectionColor()).
When i do the same thing with the mouse, it works fine (a blue background
color!)...


Wkr,
Sofie

-----Original Message-----
From: Reinstein, Lenny [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 5:31 PM
To: '[EMAIL PROTECTED]'
Subject: Highlight/selection in text component


The problem is:

I highlight text in the text component with a mouse.
Click on the button. Because the focus is no longer on the text component,
the selection/highlight disappears. However, the call to the
component.getSelectedText() will still return the selection correctly. How
can I, if possible, have the text marked as selected even though the focus
is lost?

Thanks.

-Lenny, New York.


_______________________________________________
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