[java] Reading and displaying data from a .txt file

In general:

  • Create a FileInputStream for the file.
  • Create an InputStreamReader wrapping the input stream, specifying the correct encoding
  • Optionally create a BufferedReader around the InputStreamReader, which makes it simpler to read a line at a time.
  • Read until there's no more data (e.g. readLine returns null)
  • Display data as you go or buffer it up for later.

If you need more help than that, please be more specific in your question.