Java JFileChooser

The object of JFileChooser class represents a dialog window from which the user can select file. It inherits JComponent class.

JFileChooser class declaration

Let's see the declaration for javax.swing.JFileChooser class.

public class JFileChooser extends JComponent implements Accessible

Commonly used Constructors:

Constructor Description
JFileChooser() Constructs a JFileChooser pointing to the user's default directory.
JFileChooser(File currentDirectory) Constructs a JFileChooser using the given File as the path.
JFileChooser(String currentDirectoryPath) Constructs a JFileChooser using the given path.

Java JFileChooser Example

Flash Soon


Output



Advertisement

© Sapster 2017