i make a java program that type code on frame . who compaile or run our code on frame output is transfer to our textArea . but when i trasfer that code to a file for save it from io. it save sucessfully but new line is not in my program . every think in single line . what i do help me
here is my code
file=new File("C:/vijay");
System.out.println("documentry created :- "+file.mkdir());
try
{
file=File.createTempFile("JavaApplication",".java" ,file);
fos=new FileOutputStream(file);
dos=new DataOutputStream(fos);
String demo=jta1.getText();
String demo1[]=demo.split("\n");
System.out.println(/*demo1[0]+*/" :- "+ch);
/*dos.writeUTF(demo);
DataInputStream dis=new DataInputStream(new FileInputStream(file));
String s=dis.readUTF();
System.out.println(s);
jta1.setText(s);*/
byte b[]=demo.getBytes();
dos.write(b);
}catch(Exception e) {System.out.println(e);}