Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jseeker

 
jseeker jseeker
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
help !!!
I currently have an applet that takes images out of a jar file and displays them one after another. This works just fine on my local drive and other network drives. But the second that I put in up on our web server and access it using http://, I get the following message
java.util.zip.ZipException: The system cannot find the path specified at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:112) at java.util.jar.JarFile.<init>(JarFile.java:117) at java.util.jar.JarFile.<init>(JarFile.java:55) at ImageViewerApplet.init(ImageViewerApplet.java:69) at sun.applet.AppletPanel.run(AppletPanel.java:347) at java.lang.Thread.run(Thread.java:536)
The init code of my applet is
public void init() {
URL url = null;
String param="" ;
try {
URL tmpUrl = new URL("http://<my web site>/ov/ImageViewer.jar");
System.out.println("tmpUrl = "+ tmpUrl.getPath());
JarFile jf=new JarFile(tmpUrl.getPath());
System.out.println("JarFile name is "+jf.getName());
Enumeration e=jf.entries();
while (e.hasMoreElements()) {
JarEntry je=(JarEntry)e.nextElement();
System.out.println( "je.getName()="+je.getName());
if (je.isDirectory()) {
continue;
}
else {
fileList.addElement(je.getName());
}
}
jf.close();
obDirName = getParameter("OBLIQUEIMAGESOURCE");
orDirName = getParameter("ORTHOIMAGESOURCE");
}
catch (MalformedURLException e) {e.printStackTrace();}
catch (NullPointerException e) {e.printStackTrace();}
catch (FileNotFoundException e) {e.printStackTrace();}
catch (IOException e) {e.printStackTrace();}

Thanks in advance for your help.
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi jseeker jseeker

Welcome to JavaRanch! Please adjust your display name to meet the JavaRanch Naming Policy.
You can change it here.

Also, you will get a more timely, appropriate response if you post in the appropriate forum.

Thanks!

Marilyn
 
Randall Twede
Ranch Hand
Posts: 4489
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did something like this a long time ago. i just jarred everything together with the applet. class Animals extends Canvas implements MouseListener. here is a portion of my code:

public class Farm extends java.applet.Applet implements ItemListener {
Animals an;
Text text;
Thread runner = null;
public static int selection;
/** Initializes the applet farm */
public void init () {
selection = 6;
an = new Animals(this);
text = new Text();
initComponents ();
picts.add("sheep.jpg");
picts.add("dog.gif");
picts.add("bird.jpg");
picts.add("cow.jpg");
picts.add("rooster.jpg");
picts.add("donkey.jpg");
add(BorderLayout.SOUTH,text);
add(BorderLayout.CENTER,an);
picts.addItemListener(this);
}
/** This method is called from within the init() method to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents () {//GEN-BEGIN:initComponents
picts = new java.awt.Choice ();
// End of variables declaration//GEN-END:variables
synchronized public void itemStateChanged(final java.awt.event.ItemEvent p1) {
selection = picts.getSelectedIndex();
Image im = this.getImage(this.getDocumentBase(),picts.getSelectedItem());
an.updateImage(im);
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic