JPython applets

Adrian Eyre a.eyre at optichrome.com
Fri Mar 17 12:42:01 EST 2000


Sorry if this is an inappropriate list for JPython...

On the URL: http://www.jpython.org/applets/ there are examples of
JPython applets. It would appear that the JPython interpreter is
first downloaded, but I'm not sure how this works. All I appear
to get in my browser cache is a file called appletdemo.jar which
appears to contain all the applet demos, as well as parts of the
jpython.jar.

I'm considering doing something similar, but I don't want to have
to package all the classes into the same .jar file. Can I have
the JPython stuff downloaded first, and then referred to by
individual .class files which would be downloaded later?

This is my code here:

# File: pleasework.py
from java import awt, applet

class pleasework(applet.Applet):

    def init(self):
        self.button = awt.Button('A button')
        self.add(self.button)

and the webpage:

<!file: pleasework.html>
<html>
<applet code="pleasework.class">
</html>

I ran JPython in the same directory as "pleasework.py", and
did:

>>> import pleasework
>>> ^D

I then renamed the resulting file from "pleasework$py.class" to
"pleasework.class", and ran the browser. The WWW server said the
class was successfully downloaded, but I got an error on IE saying
"load: class pleasework not found".

What am I doing wrong?

Thanks in advance for any help...

-----------------------------------------------------------------
Adrian Eyre <a.eyre at optichrome.com> - http://www.optichrome.com 





More information about the Python-list mailing list