IFSSystemView provides a gateway to the IBM® i integrated file system, for use when constructing javax.swing.JFileChooser objects.
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.IFSJavaFile;
import com.ibm.as400.access.IFSSystemView;
import javax.swing.JFileChooser;
import java.awt.Frame;
// Work with directory /Dir on the system myAS400.
AS400 system = new AS400("myAS400");
IFSJavaFile dir = new IFSJavaFile(system, "/Dir");
JFileChooser chooser = new JFileChooser(dir, new IFSSystemView(system));
Frame parent = new Frame();
int returnVal = chooser.showOpenDialog(parent);
if (returnVal == JFileChooser.APPROVE_OPTION)
{
IFSJavaFile chosenFile = (IFSJavaFile)(chooser.getSelectedFile());
System.out.println("You selected the file named " +
chosenFile.getName());
}