public void actionPerformed(ActionEvent e) {
        if (e.getActionCommand().equals("OK")){
            password = pf.getPassword();
            username = userField.getText();
            remoteDir = remdirField.getText();
            localDir = locdirField.getText();
            host = hostField.getText();
            port = Integer.parseInt(portField.getText());
            this.dispose();
        }else if (e.getActionCommand().equals("Browse")){
            JFileChooser jfc = new JFileChooser("user.dir");
            jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);            
            if (jfc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION){
                locdirField.setText(jfc.getSelectedFile().getAbsolutePath());
            }
        }else if (e.getActionCommand().equals("Cancel")){
            this.dispose();
        }
    }