Look at the Scanner class. It has methods you can use to read from a text file.