The javax.swing.JFileChooser class describes a Swing component for choosing files, usually via its int showOpenDialog(Component parent) and int showSaveDialog(Component parent) methods. In this post, I enumerate various ways to customize a file chooser.
Creating and Showing File Choosers
Q: How do I create and show a file chooser?
A: Before you can customize a file chooser, you need to know how to create one and then show it. Create a file chooser by instantiating JFileChooser via one of its constructors, such as JFileChooser(), which initializes the file chooser to the user's default directory.