Use 2 instances of JEditorPane
. Set them the same EditorKit
and then use Document
from the first one in the second.
editorPane2.setDocument(editorPane1.getDocument());
Document
is a model in fact and you can share the same model between 2 components.