can someone explain to me how i can go about implementing a string from a jtextfield and storing it to a file please. I would really appreciate some sample code on this one. Thank you

try
{
	PrintWriter out = new PrintWriter(new FileOutputStream(new File(filename)));
	String text = myTextField.getText();
	out.print(text);
	out.close()
}
catch(Exception e)
{System.out.println(e);}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.