I want to create a large text box for user input of a type. I also want it to use the default system font so that it matches the expected look and feel. So I tried using JEditorPane with a standard constructor that uses text encoding.
JEditorPane editorPane = new JEditorPane(); editorPane.setText(gettysburgAddress);

The problem is that a simple text encoding is not wrapped to a new line at the end of each word, only when it runs out of characters.
I tried using HTML encoding that wraps words:
JEditorPane editorPane = new JEditorPane("text/html", ""); editorPane.setText(gettysburgAddress);

This has the word wrap, but by default it is different from the default font for the system (Helvetica on Mac OS X, which I don't want.
How can I get the best of both worlds: word wrap and default font for the system? I don't need any special formatting or anything like that, so a simple text encoding will do if possible.
source share