Example - Recursive List
Here is an example of listing files and directories recursively..
Example - FileTest.java
This program prints many of the File charactistics..
System Independent Newline Characters
There are three different major systems for indicating the end of a line (new line): One for Unix, one for the Macintosh, and one for DOS/Windows..
Example - Read into textarea
This example program reads from a file into a textarea..
Example - Read Words
The program below reads a text file and lists the words alphabetically..
Example - NanoEdit
This program is the simplest text editor you can imagine..
java.io.FileFilter
The lists of files or file names returned by the File listFiles() and list() methods include all files and directories..
javax.swing.filechooser.FileFilter
To create a custom file filter to show only specific files in a file chooser dialog, subclass javax.swing.filechooser.FileFilter and use this with the chooser..
File Filters
There are two common uses of file filters, which restrict the choice of files..
BufferedReader/Writer
java.io.BufferedReader and java.io.BufferedWriter are used to read/write Strings from/to text files..
File I/O - Text Files
Java can read several types of information from files: binary.
java.io.File
java.io.File is the central class in working with files and directories..