void writeTeXFile(){
        dir = new File(usrHomeDirStr+"/PSTricksGraphEditorTest");
        file = new File(usrHomeDirStr+"/PSTricksGraphEditorTest/test.tex");
        try{
            dir.mkdir();
            file.createNewFile();
            fileWriter = new PrintWriter(file);
            fileWriter.print(new LaTeXDocument().getDocumentContents());
            results.append("Test File test.tex created in directory " + 
                    usrHomeDirStr + "/PSTricksGraphEditorTest" + newLine);
        } catch (IOException e){
            results.append("Error when creating test.tex\n" + e.toString());
            return;
        } finally {
            fileWriter.close();
        }
    }