Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jseeker  RSS feed

jseeker jseeker
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 The system cannot find the path specified at Method) at<init>( at java.util.jar.JarFile.<init>( at java.util.jar.JarFile.<init>( at ImageViewerApplet.init( at at
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()) {
else {
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
Posts: 9080
  • 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.


Randall Twede
Ranch Hand
Posts: 4690
Java 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 ();
/** 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());
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!