I'm making an address book and I need to cycle through my contacts. The contacts are imported from file and are read into the JTextField
s as so:
name
phone
mobile
address
How do I go about doing this?
I've tried, it runs but the buttons do nothing.
edit: now using this:
public void importContacts()
{
try
{
BufferedReader infoReader = new BufferedReader(new FileReader("../files/example.txt"));
txtName .setText(readLine(infoReader));
txtPhone .setText(readLine(infoReader));
txtMobile .setText(readLine(infoReader));
txtAddress.setText(readLine(infoReader));
}
catch (IOException ioe)
{
JOptionPane.showMessageDialog(null, ioe.getMessage());
}
}