btnLoc.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFileChooser fc = new JFileChooser(location);
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int res = fc.showOpenDialog(PackagesPanel.this.installer);
if (res==JFileChooser.APPROVE_OPTION) {
// first choose selection
location = fc.getSelectedFile();
// if user entered directory but no selection, choose it instead
if (location==null) location = fc.getCurrentDirectory();