How to implement a wrap in Jtextarea

xiaoxiao2021-03-06  36

1, the constructor specifies the number of lines.

Jtextarea textarea = new jtextarea (3, 1); // 3 line 1 column

2, specify the content.

TextArea.setText ("New Page Dialog

/ NDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD ");

3, output.

New page dialog prompt

DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDd

转载请注明原文地址:https://www.9cbs.com/read-70274.html

New Post(0)