void viewPDF(){
        try{
            // different OS has different methods to open pdf file
            if(OS.startsWith("Windows")){
                Process p = Runtime.getRuntime()
                .exec("rundll32 url.dll,FileProtocolHandler " +usrHomeDirStr+ 
                        "/PSTricksGraphEditorTest/test.pdf");
                p.waitFor();
                results.append(newLine + "Done!");
            } else {
                Process p = Runtime.getRuntime().exec("open "+usrHomeDirStr+
                        "/PSTricksGraphEditorTest/test.pdf");
                results.append(newLine + "Done!");
            }
            
        } catch (Exception e){
            results.append(newLine + e.toString() + newLine);
        }
    }