ok so the thing is im trying to save information from a register page into a file
else if(ae.getSource()==b1)
{
fname=t1.getText();
lname=t2.getText();
rol=t3.getText();
branch=cb1.getSelectedItem().toString();
username=t5.getText();
password=t6.getText();
username.savedata();
setVisible(false);
}
the username file is---
package Proj;
import java.io.*;
public class username
{
public static void savedata()
{
try
{
FileWriter obj=new FileWriter("usr",true);
obj.write(register.fname+"^^"+register.lname+"^^"+register.rol+"^^"+register.branch+"^^"+register.username+"^^"+register.password+"&"+"\n");
obj.flush();
}
catch(Exception e)
{
System.out.println(e);
}
}
}
im getting an error a cannot find symbol error while compiling register.java
at username.savedata(); (with ^ pointing to (.) {dot})
i wanna use the savedata() from the username.java file in register.java to save the contents of the text boxes.....
what am i doing wrong???? i declared savedata() as public,static..what else????