Beispiel mit JNLP API
-
Beispielcode mit FileOpenService:
import javax.jnlp.*;
...
FileOpenService fos;
try {
fos=(FileOpenService)ServiceManager.lookup("javax.jnlp.FileOpenService");
} catch (UnavailableServiceException
e)
{ fos = null; }
if (fos != null) {
try {
// ask user to select a file through
this service
FileContents fc =
fos.openFileDialog(null, null);
// as user to select multiple files
through this service
FileContents [] fcs =
fos.openMultiFileDialog(null, null);
} catch (Exception e)
{ e.printStackTrace(); }
}