private boolean writeFileOrShowError(String file, JTextComponent source) {
        try {
            FileUtils.writeStringToFile(new File(file), source.getText());
            source.requestFocus();
            return true;
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(this, "The file could not be written: " + ex.getLocalizedMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }

        return false;
    }