I have a .txt file that has a text on it, and i want to read from it and show it on a JTextField but I dont know how to code it.
So far here's what i know:
viewIO = new DataInputStream(new FileInputStream(phoneList.getModel().getElementAt(phoneList.getSelectedIndex())+".dat"));
for(int x = 0; x < 5; x++)
{
field[x].setText(viewIO.readUTF());
}
is this code will work? nothing appears on the JTextField as the program runs