Board index » jbuilder » JTextPane & get removed text

JTextPane & get removed text


2004-04-08 06:12:32 PM
jbuilder8
Hi,
I'm programming a text editor and use a JTextpane for it.
I added a DocumentListener to it, so that the functions insertUpdate() and
removeUpdate() are called everytime when someone inserts or removes text.
Now in the function removeUpdate() i somehow need to know which text was removed
as a String.
Is this possible?
Thanks for your help,
Andreas
 
 

Re:JTextPane & get removed text

Quote
I'm programming a text editor and use a JTextpane for it.
I added a DocumentListener to it, so that the functions insertUpdate() and
removeUpdate() are called everytime when someone inserts or removes text.
Now in the function removeUpdate() i somehow need to know which text was
removed
as a String.
Is this possible?
not with removeUpdate() - it called *after* changes were made.
the easy way is to override Document#remove(int off, int len) method.
____________
reader.imagero.com the best java image reader.