System.out.println("Error: File not saved: Could write to file."); e.printStackTrace();
String errmsg = "Could not write to file: " + ips.getAbsolutePath() + "\n" + e.getClass() + ": " + e.getMessage(), errtitle = "Error: File not saved"; JOptionPane.showMessageDialog(null, errmsg, errtitle, JOptionPane.ERROR_MESSAGE); System.out.println(errtitle + ": " + errmsg);
    public void saveIPSFile(File ips)    {        try        {            FileOutputStream out = new FileOutputStream(ips);            out.write("PATCH".getBytes());            for (int i = 0; i < this.getRecordCount(); i++)            {                out.write(this.getRecord(i).toByteArr());            }            out.write("EOF".getBytes());            out.close();        }        catch (FileNotFoundException e)        {            System.out.println("Error: File not saved: File not found.");            e.printStackTrace();        }        catch (IOException e)        {            System.out.println("Error: File not saved: Could write to file.");            e.printStackTrace();        }    }