is there any alternative for this code to run without exception?
The above code will launch a JFrame with a JTextPane on it, but it generates an IllegalStateException upon inserting a string to the JTextPane. My goal is to make the program react to the change in the JTextPane's document and this reaction to the change is by inserting a String to the same document where the event came from.Is there any other way to accomplish this task?
Joined: Aug 06, 2009
if the cause of is exception is the possible infinite invocation of the DocumentListener, is there a way where only text changes can be listened not font color, size or any other changes only the textcontent of the document will be listened?