Interesting problem, there might be some sophiticated method using the Document interface; but basically create two side by side JTextPanes(). You could spend a lot of time trying to auto measure the text so it split in two, but I would just try to find a paragraph boundary in the middle which roughly balances the number of non-whitespace characters. If the text is already structured you can look at the Document
int findSplitBoundary(String x) {
int midPoint = x.length()/2;
for (int i = 0; i < Math.min(x.length()/2 - 2, 100); i++) {
if (x.startsWith(".\n", midPoint - i)) return midPoint- i;
if (x.startsWith(".\n", midPoint + i)) return midPoint- i;
}
return midPoint;
}
Then add your text to the panes as such:
JTextPane column1 = new JTextPane();
JTextPane column2 = new JTextPane();
split=findSplitBoundary(longText);
column1.setText(longText.substring(0, split));
column2.setText(longText.substring(split));
add(column1, BorderLayout.WEST);
add(column2, BorderLayout.EAST);
Also you might find some luck looking at the HTMLEditorKit, though I don't know if HTML offers the kind of text splitting.
column1.setEditorKit(new HTMLEditorKit());