A file chooser encapsulates calls to OSPRuntime methods that let you choose a file for reading or writing.
To add a file chooser reader element to your model, drag the icon element to the list of your model elements and set the "Description" and "Extensions" fields to a constant String (as in "My files" and "xml,txt", respectively) or link them to String model variables (as in %myModelString%).
Use the buttons to the right of the fields for easier selection.
A call to the element method String chooseFilename(Component _parentComponent, boolean _toSave) will let you choose a file and return its name. The name is returned relative to your simulation's home directory.
The _parentComponent argument instructs the file chooser to appear on top of one of your view (Swing-based) elements. Using your main window is just fine. The _toSave boolean argument indicated whether you want this fale to save or read from it. This has the only eect of preparing the labels of the fiel chooser accordingly.
String filename = fileChooser.chooseFilename(_view.mainFrame,false); // false = to read from it // Now, do whatever you want with this filename (like passing it to a variable linked to a DataReader element)...