I have a project that is due tonight that I have mostly completed but I am having a hard time putting a GUI on it, specifically getting the file printed onto the GUI rather than in the terminal window.
private JFrame frame;
private JTextArea area;
private Font font;
private Directory directory;
private String name;
private String firstName;
private String lastName;
public GUI()
{
makeFrame();
directory = new Directory();
directory.FileRead();
String name = (firstName + lastName);
directory.findPerson(name);
directory.listDirectory();
writeTextArea(name);
font = new Font("Verdana", Font.PLAIN, 10);
}
private void writeTextArea(String instr)
{
area.append(instr);
}
I keep getting a NullPointerException for area.append(instr);. How do I fix this?