Updating text file in java
A text field is a basic text control that enables the user to type a small amount of text.
When the user indicates that text entry is complete (usually by pressing Enter), the text field fires an action event.
The following example displays a basic text field and a text area. Click the Launch button to run Text Demo using Java™ Web Start (download JDK 7 or later).
Alternatively, to compile and run the example yourself, consult the example index.
class, text fields are very flexible and can be customized almost any way you like.
For example, you can add a document listener or a document filter to be notified when the text changes, and in the filter case you can modify the text field accordingly.
If you need to obtain more than one line of input from the user, use a text area.
In java we can write file with File Writer class with Buffered Writer class.write() method is used to create file and write the content in file.