How can I do to discover the current position of the cursor in a textpane??? for example if the user keeps surfing on the text. Is there a way to discover the position of the cursor on the text in a jtextpane???
By cursor, you may mean what Swing calls the caret. Check out getCaret() and getCaretPostion() on the javax.swing.text.JTextComponent class, and also the javax.swing.textCaret class.
You would need to write yourself a little parser to scan through the input and look for specific words/patterns. You could use Regular Expressions to do this. Once you identify such a pattern you can edit it out. [ December 19, 2002: Message edited by: Cindy Glass ]
"JavaRanch, where the deer and the Certified play" - David O'Meara
and POOF! You're gone! But look, this tiny ad is still here:
a bit of art, as a gift, the permaculture playing cards