Dear All
I am trying to learn JAVA with Eclipse.I have a class like and it has a form which contains 4 text fields.When I press the submit button(Register) I want my program to put every thing into a file(test.txt) line by line.
I tried to do something from my study book but it does not work.I can not see any input in the external file.
I would be very happy if anyone can help me to learn further
Thanks in advance

Here is the codes

public class Form extends JFrame implements ActionListener 
	String[] Reg = {"","","",""};
	JButton b1;
	JTextField tf1;
	JTextField tf2;
	JTextField tf3;
	JTextField tf4;

please assume the rest of codes are working well!

public void actionPerformed(ActionEvent ae) 
    	String strSource = ae .getActionCommand( );
    	PrintWriter print;
    	 	 print=new PrintWriter(new BufferedWriter(new FileWriter("test.txt")));
    			for(int x=0; x<4; x++)
    	          		print.print(Reg[x] + " ");
    		catch (IOException e1) 
    	}//end if

Do you mean the file is empty, or is there no file at all?
After line 9 try
to help locate the problem.

it does not change anyting :(
i put this line System.out.println(Arrays.toString(Reg));
on the line you specified.
Something is definetely missing but no idea...

If that didn't output anything then it suggests that your actionPerformed method isn't being called OR the if test on line 4 is failing...
NB You shouldn't compare Strings with ==
You must use the equals(...) method of the String class