| Author |
how to redirect backspace key to some other function
|
danish shaikh
Greenhorn
Joined: Nov 09, 2004
Posts: 21
|
|
Hi all, i want to create TextEditor with track changes facility as in MSWORD 2003. ie. whenever i delete some text they do not be physically erased instead, the deleted text shud be displayed in some other color with strike out.. so plz help me its quite urgent. Bye, thanks in advance.
|
 |
Jeff Bosch
Ranch Hand
Joined: Jul 30, 2003
Posts: 804
|
|
|
You can define the key's action in your ActionListener actionPerformed method.
|
Give a man a fish, he'll eat for one day. <br />Teach a man to fish, he'll drink all your beer.<br /> <br />Cheers,<br /> <br />Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
|
 |
danish shaikh
Greenhorn
Joined: Nov 09, 2004
Posts: 21
|
|
thanks for reply, But.... i have included the code in the key event. i also cosumed the backspace key. now i want to edit the document but its showing me the the error msg.. java.lang.IllegalStateException: Attempt to mutate in notification at javax.swing.text.AbstractDocument.writeLock(AbstractDocument.java:1336) at javax.swing.text.AbstractDocument.remove(AbstractDocument.java:569) how can i overcome this problem. Thanks in advance..... Reply soon
|
 |
 |
|
|
subject: how to redirect backspace key to some other function
|
|
|