View Single Post
  #1 (permalink)  
Old 02-06-2008, 02:01 AM
willemjav willemjav is offline
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 235
willemjav is on a distinguished road
reading dir in java applets
Hello there,
I canīt make this the following methode to work inside a applet it wont give me the dir. and not even one of the panes.
please give me a hint

Willemjav


private void readImageFilelist(String dirname) { // gets the list of images
directory = new File(dirname);
if (directory.isDirectory() == false) {
if (directory.exists() == false)
JOptionPane.showMessageDialog(infoPane," there is no directory called " + directory);
else
JOptionPane.showMessageDialog(infoPane, directory + " is not a directory.");
}
else {
JOptionPane.showMessageDialog(infoPane, directory + " it works");
files = directory.list(); // stores the list of file names
Imagearray = new Image[files.length];
for (int i = 0; i < files.length; i++) {
String str = files[i];
Imagearray[i] = downloadImage(str); // stores each image in a array for display
}

}

}
Reply With Quote
Sponsored Links