1

I recently updated my Java to the most up to date version and this caused an applet that I work with to not run correctly. I have changed the security parameters for Java through the Control Panel to the lowest possible settings but my applet still does not run. Here is what my applet looked like:

<HTML>
 <BODY BGCOLOR="#003333">

 <p>
 <APPLET name=IpixViewer code=IpixViewer.class archive="IpixViewer.jar" width=450      height=450>
<PARAM NAME="url" VALUE="209_a_CHEM.ipx">
 </APPLET>
 </p>

 </BODY>
 </HTML>

I tried to use the HTML tag as a work around but this also is failing. Here is that code:

<HTML>
<body>
<p>
<object type="application/x-java-applet;version=1.6" name="IpixViewer" id="ipixviewer"  style="width:450px;height:450px" >
<param name="code" value="IpixViewer.class" >
<param name="archive" value="IpixViewer.jar" >
<param name="codebase" value="Z:\filepath\">
<param name="url" value="205_a_CHEM.ipx" >

</object>
</p>
</body>
</HTML>

I think the issue is when I try to pass the url parameter into the applet but I am not sure. Any help would be appreciated.

2 Answers 2

0

The parameter CODEBASE is used to add a path to the jar file, e.g.:

CODEBASE="./my_path_to_jar"

So to draw a complete picture, this is a working example:

<HTML>
  <HEAD></HEAD>
  <BODY>
    <APPLET NAME="IpixViewer"
            CODE="IpixViewer.class" 
            CODEBASE="."
            ARCHIVE="IpixViewer.jar" 
            WIDTH="320" HEIGH="240" >
    <PARAM NAME="URL" VALUE="image.ipx">
  </APPLET>
</BODY>
</HTML>

This HTML file (ipix.html), the jar file IpixViewer.jar and the image image.ipx are all placed in the same folder.

As it is not easily possible to start an applet from a local hard disk, I used a tool called HFS to access the website. For this just start the program, drop the files on it and type http://127.0.0.1/ipix.html.

If this doesn't help you can open a Java console in order to retrieve further information.

Sign up to request clarification or add additional context in comments.

3 Comments

This is what my Java console shows: \Java version: 1.7.0_25 JVM version: 23.25-b01 JVM vendor: Oracle Corporation Java specification name: Java Platform API Specification Java specification vendor: Oracle Corporation Java specification version: 1.7 OS architecture: x86 OS name: Windows 7 OS version: 6.1 Browser: Mozilla/4.0 (Windows 7 6.1) Loading IPIX: 'null'... Exception in thread "Thread-15" java.lang.NullPointerException at IpixViewer.a(IpixViewer.java) at IpixViewer.f(IpixViewer.java) at IpixViewer.run(IpixViewer.java) at java.lang.Thread.run(Unknown Source)
Ok, I was slightly on a wrong track. Just made a small test and it worked quite well. Note that it is not possible to start from a folder directly.
In particular, the codebase parameter needs to be a URI, not a file path. Z:\filepath\⁠ is not a valid URI, but file:///Z:/filepath/ is. A URI always contains forward slashes, on every operating system.
0

Give the java deployment toolkit a try. It will work great and handles cross browser compatibility.

http://www.java.com/en/download/faq/deployment_toolkit.xml

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.