private boolean processFile(boolean encode) throws IOException
    {
        mcipher = new MonoCipher(keyField.getText());
        char[] buffArray = new char[textFile.length];

        if(encode)
            for(int i = 0; i < textFile.length; i++)
                buffArray[i] = mcipher.encode(textFile[i]);
        else
            for(int i = 0; i < textFile.length; i++)
                buffArray[i] = mcipher.decode(textFile[i]);

        FileWriter out = null;
        try
        {
            if(encode) out = new FileWriter(root + "C.txt");
            else out = new FileWriter(root + "D.txt");

            out.write(buffArray);
        }
        finally { if (out != null) out.close(); }

        return true;  // replace with your code
    }