public Gphelper() {
        initComponents();
        boolean bOk;
        String errText = "";
        SystemCommand cmd = new SystemCommand();
        gpgCommand = "gpg2";
        cmd.setCommand(gpgCommand + " --batch --version");
        bOk = cmd.run();
        if (bOk == false) {
            gpgCommand = "gpg";
            cmd.setCommand(gpgCommand + " --batch --version");
            bOk = cmd.run();
        }
        if (bOk) {
            List<String> stdout = cmd.getStdout();
            getGpgVersion(stdout);
        }
        if (bOk) {
            // get public keys
            cmd.setCommand(gpgCommand + " --batch --list-keys");
            bOk = cmd.run();
            if (bOk) {
                List<String> stdout = cmd.getStdout();
                retrievePublicKeys(stdout);
            }
        }
        if (bOk) {
            // get secret keys
            cmd.setCommand(gpgCommand + " --batch --list-secret-keys");
            bOk = cmd.run();
            if (bOk) {
                List<String> stdout = cmd.getStdout();
                retrieveSecretKeys(stdout);
            }
        }
        if (bOk == false) {
            if (errText.length() == 0) {
                List<String> stderr = cmd.getStderr();
                for (String stderr1 : stderr) {
                    errText = errText + stderr1 + "\n";
                }
            }
            JOptionPane.showMessageDialog(null,errText,"GPG error",JOptionPane.ERROR_MESSAGE);
            jButtonEncrypt.setEnabled(false);
            jButtonDecrypt.setEnabled(false);
            jMenuEncryptFile.setEnabled(false);
            jMenuDecryptFile.setEnabled(false);
        }
        
        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension size = getSize();
        int x = (screen.width / 2) - (size.width / 2);
        int y = (screen.height / 2) - (size.height / 2);
        setLocation(new Point(x, y));
    }