import javax.swing.*;

class DateiWahl {

	public static void main(String[] args) {
		JFileChooser chooser = new JFileChooser();
		int returnVal = chooser.showOpenDialog(null);
		if (returnVal == JFileChooser.APPROVE_OPTION) {
			System.out.println("Dateiname: "
					+ chooser.getSelectedFile().getName());
		}
		System.exit(0);
	}
}
