FileChooser - como usar

JFrame frame = new JFrame();

JLabel texto = new JLabel("Arquivo");

 

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JFileChooser fs = new JFileChooser();

fs.showSaveDialog(frame);

if (fs.getSelectedFile() != null) 

 texto.setText(fs.getSelectedFile().toString());

 

frame.getContentPane().add(BorderLayout.CENTER, texto);

frame.setSize(300,300);

frame.setVisible(true);