public static JPanel fileSelectorPanel(
			final JTextComponent tf,
			boolean selectFolder, boolean selectFile
			) {
		JPanel panel = new JPanel();
		panel.setLayout(new BorderLayout());
	    panel.add(tf, BorderLayout.CENTER);
	    panel.add(browseButton(new P1<String>() {
			public void e(String obj) {
				tf.requestFocus();
				tf.setText(obj);
			}
		}, new F0<String>() {public String e() {
	        return tf.getText();
	    }},selectFolder, selectFile), BorderLayout.EAST);
		return panel;
	}