Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-07-2008, 01:08 AM
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 238
willemjav is on a distinguished road
Problems with file dir
Problems with file dir

I did read some articles about security and I am aware of that issue concerning applets. I wrote a small slide show application for use on my web-side. 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?

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
}

}

}


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);


}
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
File fp = new File(filePath);fp.exists() does not yeild proper result ganeshp Advanced Java 1 12-27-2007 12:42 AM
Problems sending file throught TCP sockets Nite Advanced Java 2 08-04-2007 10:01 PM
problems trying to view the contents of a text file in JTextArea warship New To Java 1 07-19-2007 12:20 AM
problems with the name of file bbq Java Servlet 0 06-28-2007 05:47 AM
count character in text file as input file aNNuur New To Java 0 06-18-2007 07:46 AM


All times are GMT +3. The time now is 02:11 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org