View Single Post
  #3 (permalink)  
Old 02-07-2008, 12:58 AM
willemjav willemjav is offline
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 326
willemjav is on a distinguished road
dear hardwired

I did read some articles about security and I am aware of that issue concerning applets. Thanks for sending me that link anyway. I wrote a small slide show application for use on my web-site. Photos are present in a file folder called Imagestore and the applet should look for them on the server and download the content of the folder into the applet (I AM NOT TRYING TO ENTER A CLIENT ENVIRONMENT). The method (see bottom) reads simply the file directory of the file Imagestore and stores it into an array, which I copy into an image array for display. The application version works perfect but not the applet. The problem is the following method (when left out, the applet works okay). I do not understand which security issue is involved here. The panes should give me some feedback but they don´t.... the applet refuses to popup and I do not know way?

willem

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
}

}

}


and for display

public void paintComponent(Graphics g) {

if (Imagearray != null) {
count++;
if (count==Imagearray.length)
count = 0;
g.drawImage(Imagearray[count],0,0,getWidth(), getHeight(), this);
}
else
g.drawImage(testimage,0,0,getWidth(), getHeight(), this);


}
Reply With Quote