Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JTextArea当读取遇到 CR LF 值时,我想读取文件并将其行包装成 a 。
JTextArea
JTextArea有类似的方法setLineWrap,setWrapStyleWord但不这样做!
setLineWrap
setWrapStyleWord
谢谢。
只需将 CRLF 替换为 \n
您提到的 Linewrapping 方法略有不同 - 它们包装的线条太长而无法放入 JTextArea。
\r (CR) 不会换行 (LF) 。 \n (LF) 将换行。 \r\n (CRLF) 将换行。
很奇怪,jTextArea 没有为此提供配置选项。