String text = "";if(!"".equals(jta.getText())){ text = jta.getText().replaceAll("\n","\r\n");}fos.write(text.getBytes());其实本来就有换行,换个文本编辑器就能看到