I am trying to write the content of the textfields to a file on my computer. i want to write the content of the textfield to a text file. When it has been written the content should look like this: content of Textfield1 followed by new line x'ter content of Textfield2 followed by new line x'ter content of Textfield3 followed by new line x'ter content of Textfield4 followed by new line x'ter end of file x'ter. Also, i want to be able to write content of a Textfile to the Textfield.Like this: Textfield1=line1 Textfield2=line2 Textfield3=line3 Textfield3=line4 How can i achieve this? Here is a section of a program i have written package DAYOSPACKAGE.test1; import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.event.*; import java.io.*; //package DAYOSPACKAGE.test1; public class testing2 extends JFrame { private JTextField T1[]; private JButton B1,B2; private JLabel L1[]; private JPanel P1,P2,P3; private ObjectOutputStream output; public testing2() { T1=new JTextField[4]; for(int i=0;i<T1.length;i++) { T1=new JTextField(); }