Java Swing filling multiple JTextFields with data from a text file

I'm trying to make a Contacts Book using swing and I have a problem with filling my text fields with data from a file.

I have boxes for first name, surname, address and phone number (string) and the structure of text file is like this:

Name

Surname

Address

Phone

Name

Surname

Address

Phone

...

I have an ArrayList to hold the contacts, and when instead of reading data from the file I use contacts.add(String, String, String, String) I successfully display the data in TextFields.

I tried this to read from the file, but it doesn't seem to work.

try {

this.myFile = new File("contacts.txt");

this.scan...

Read More »

By: StackOverFlow - Monday, 16 April

Related Posts