Jython applets newbie report and help request (Thanks D-Man)!!!

D-Man dsh8290 at rit.edu
Thu May 31 10:51:16 EDT 2001


On Thu, May 31, 2001 at 02:52:36AM +0000, Ron Stephens wrote:
| Now, my whole purpose in this is to use them as java applets on html
| pages on my web site. I am now having trouble doing this, although I
| haven't been trying for long since i just finally got the compiled java
| classes and jar files finished, finally
|
| But my first attempt failed. I created an HTML page and entered a java
| applet using a jar file as so
| 
| <HTML>
| <BODY>
| 
| <APPLET CODE="jython-jyesno" ARCHIVE="jython-jyesno.jar">
| 
| </BODY>
| </HTML>
| 
| nothing happens when I view this HTML page with a web browser.
| 
| I assume I have to use the jar file, rather than the class file, in
| order to include all the necessary code to run jython applets?
| Can anyone give me a pointer on what to try next?

Yes, you need to have the jar file to get all the class files needed.
Make sure the jar file can be found by the web browser -- that is a
problem I have sometimes had.

(this HTML snippet was copied from the Jython demo applets on
jython.sourceforge.net/applets/index.html)

<APPLET CODE="HelloWorld" WIDTH="160" HEIGHT="50"
    ARCHIVE="appletdemo.jar" 
    NAME="HelloWorld"
    ALIGN="BOTTOM" 
    alt="This browser doesn't support JDK 1.1 applets.">

In the <APPLET> tag the CODE and ARCHIVE are the most important
arguments.  The ARCHIVE must specifiy the path to the jar file.  The
CODE argument specifies the fully qualified Java name of your "main"
class (include packages separated by a '.').


With Netscape 6 on Windows 2000 there is the "Java console" which is
really helpful for displaying error messages (such as the JVM not
being able to find the jar/class) and (Java) stack traces.  You can
see this console if you right-click on the Duke guy in the System Tray
and selecting "Show Console".

HTH,
-D





More information about the Python-list mailing list