>At 07:27 AM 2/2/2001, you wrote:
>I am just getting started with JTextPane, so bear with me if the question is
>not advanced enough.

FYI, there is also [EMAIL PROTECTED] (not advanced swing list).

>However, when the document changes, how do we keep track of the position of
>the styled text in a document? Of course I can have a simple caret position
>variable and increment/decrement it every time the document changes. But I
>am sure there's a better and more efficient way defined in Swing. Can
>someone help/provide a simple example?

Take a look at javax.swing.text.Document.createPosition(int).  Generally, 
an instance of the Position class is what you want.


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

Reply via email to