File dir = new File(directory.getText()); JFileChooser chooser = new JFileChooser(dir.getParent()); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setSelectedFile(dir);
if(evt.getSource() == choose) { File dir = new File(directory.getText()); JFileChooser chooser = new JFileChooser(dir.getParent()); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setSelectedFile(dir);
		public void actionPerformed(ActionEvent evt)		{			File dir = new File(directory.getText());			JFileChooser chooser = new JFileChooser(dir.getParent());			chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);			chooser.setSelectedFile(dir);			if(chooser.showOpenDialog(SearchDialog.this)				== JFileChooser.APPROVE_OPTION)				directory.setText(chooser.getSelectedFile().getPath());		}