loic
loic

Reputation: 1

how can we know the JeditorPane associated with a document in the documentEvent

To chain block of texts in a desktop java application, I Have inherited from the JEditorPane to make blocks ot text. My problem is that in the documentEvent I need to retrieve informations associated with the associated JEditorPane. But I don't understand the way to make the link between the documentEvent and the JEditorPane. Thank's for your help

Upvotes: 0

Views: 24

Answers (1)

StanislavL
StanislavL

Reputation: 57421

No way. The Document is just a model. The same document instance could be set to multiple JEditorPanes.

jEditlorPane2.setDocument(jEditlorPane1.getDocument())

You can get list of all JEditorPane instances existing and iterate through the list checking whether Document instance equals to jEditorPaneInstance.getDocument()

Upvotes: 1

Related Questions