Q:

Save the line break in JTextField

How to save the line break when insert text from the Clipboard into the JTextField?
I found way to solve this problem. 
It is setDocument() method from JTextField:
public void setDocument(Document doc) {
    if (doc != null) {
        doc.putProperty("filterNewlines", Boolean.TRUE);
    }
    super.setDocument(doc);
}

Plus to this create your own realization of AbstractDocument, which will have single-line structure.

A:

A JTextField is for a single line of text only. You can use a JTextArea instead.

A:

JTextField doesn't support multiple line text. Use JTextArea or JEditorPane instead.

