According to Key Bindings the Enter key is mapped to the "insert-break" Acton.
In Windows this Action is defined in the DefaultEditorKit
:
public static class InsertBreakAction extends TextAction {
/**
* Creates this object with the appropriate identifier.
*/
public InsertBreakAction() {
super(insertBreakAction);
}
/**
* The operation to perform when this action is triggered.
*
* @param e the action event
*/
public void actionPerformed(ActionEvent e) {
JTextComponent target = getTextComponent(e);
if (target != null) {
if ((! target.isEditable()) || (! target.isEnabled())) {
UIManager.getLookAndFeel().provideErrorFeedback(target);
return;
}
target.replaceSelection("\n");
}
}
}
and simply adds "\n" as you suggest.
If you have different behaviour on Linux then I would guess a custom Action is added to the HTMLEditorKit to insert the paragraph tag.
So I would suggest you need to find that Action and then add it to the HTMLEditorKit in the Windows platform.