I want to access image files contained in a directory, and I would like
to scan the whole directory. When I use the appletviewer, the following
code gives me a list of the files in the dir, but not with Netscape. I
think the security manager throws an exception, but how can I access a
directory from an applet then?
thank's for your help!
Frank
private void scan_directory() {
dialog = new SimpleFileDialog(this,
"Select a file!");
dialog.show();
PrintWriter out = new PrintWriter(System.out,
true);
try {
File dir = new File(dialog.getDirectory());
String str = new String(dialog.getFile());
char c = str.charAt(0);
setText("Directory: " + dialog.getDirectory());
for (int i = 0; i < dir.list().length; i ++) {
setText("File " + i +": " + dir.list()[i]);
}
} catch (Exception ev) {
FileButton.window.dispose();
out.println("keine datei geladen...(EXC)!");
}
}
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
- Re: Newbie: How do I get dir listings from applets? Frank Lümkemann
- Re: Newbie: How do I get dir listings from applets? Nathan Meyers
- RPMs for Blackdown Ian Corner
- Re: Newbie: How do I get dir listings from applets? Michael Sinz