private void OKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OKActionPerformed
        int returnValue = fs.showSaveDialog(encryptFrame.this);
        if(returnValue == JFileChooser.APPROVE_OPTION)
        {
        savefile = fs.getSelectedFile();
        String saveFileName = "" +savefile;
        int saveFileLength = saveFileName.length();
        //System.out.println(saveFileName + "      "+saveFileLength);
        if(saveFileLength<4)
            saveFileName += ".png";
        if(saveFileName.charAt(saveFileLength-4)!='.'
                && saveFileName.charAt(saveFileLength-3)!='p'
                && saveFileName.charAt(saveFileLength-2)!='n'
                && saveFileName.charAt(saveFileLength-1)!='g')
            saveFileName += ".png";
        saveFileLength = saveFileName.length();
        //System.out.println(saveFileName + "      "+saveFileLength);
        msg=jTextArea1.getText();
        pass = jTextField2.getText();
        //System.out.println("msg="+msg+" pass= "+pass);
        //System.out.println(str);
        code=crypt(new BigInteger("3078434453"),new BigInteger("5"),msg);
        code1=crypt(new BigInteger("3078434453"),new BigInteger("5"),pass);
        //System.out.println("code="+code);
        int k=code.length();
        bin1=binary_code(k,code);
        k = code1.length();
        bin2 = binary_code(k,code1);
        //System.out.println("bin1="+bin1);
        //System.out.println("bin2="+bin2);
        a=bin1.length()+ bin2.length();
        a1 = bin2.length();
        bin1 =bin1+ bin2;
        
        //System.out.println("a="+a);
                    try {
                        encode(a, file, saveFileName);
                    } catch (IOException ex1) {
                        Logger.getLogger(encryptFrame.class.getName()).log(Level.SEVERE, null, ex1);
                    }
        }
        else
            return;

        this.setVisible(false);
}//GEN-LAST:event_OKActionPerformed