I have a JTextPane that has a DocumentListener awaiting changes to the underlying HTML document. When the content changes, the event uses JTextPane.scrollToReference to move the view to a specific reference anchor. The problem is that the underlying View in JTextPane also listens for document changes and is not updated until my listener executes, which raises an exception. Is there a way to get my DocumentListener to execute after any other event listener for this particular event? Or can I somehow wait for the view to refresh before my code runs?
Jared source
share