From: James S. <bit...@ph...> - 2002-02-05 02:48:45
|
Syver Enstad <syv...@on...> wrote on 2/5/2002 1:34:50 PM: >I can recommend you get New Riders jython book. It goes through why >things like this happens really thoroughly and has been a lot of help to >me, in clearing these kinds of problems and understanding why they happen. I'll look it up, of course getting it in New Zealand might be a challenge (always Amazon I guess) :-) >Of the top of my head I can suggest, compiling your applet with the >--jar --core --deep options. Hmm, I thought I had tried jaring the small hello-world applet, just tried again and it worked (at least here at work on win2k, but should work at home as well, I'm using the same plugin version). So, I know that I can compile working applets :-) >Your .py file must have the same name as >your class, and watch out for the message from jythonc that your >python class is extending the java class, JApplet in your case. Ok, I think this is where I am going wrong. The file i want to compile, wddxTreeApplet.py has four top level classes in it - wddxNode (which extends swing.tree.DefaultMutableTreeNode), wddxTreeModel (extending swing.tree.DefaultTreeModel), wddxTree (extending swing.JTree) and wddxTreeApplet (extending swing.JApplet). Some of those classes have private classes defined within them (eg wddxTree includes a definition for class mouseListener(awt.event.MouseAdapter) ). Is it OK to have more than one top level class in a jython file to be compiled, or do I have to split those top-level classes into wddxNode.py, wddxTreeModel.py, wddxTree.py and the existing wddxTreeApplet.py. Presumadly private classes are OK to be defined within a previous class ? What about if I want to use a natively written python class (i.e a class not extending any java class/interface), is that simply not possible (I don't want to at the moment, but seems like it could be annoying to have to extend a java class for every class you want to write) ? >If >jythonc doesn't say this you got something wrong, imports or classpath >problems maybe. It's good to remember that jythonc compilation is nothing >like ordinary java compilation so don't count on really basic errors >being flagged just because it compiles. Yes, jythonc for the wddxTreeApplet isn't saying that wddxTreeApplet is extending JApplet (or anything for that matter), so I'm thinking that what I've said above is where the problem lies. >Be aware that you can specify more than one jar file in your applet >tag. >Like this: archive="jarnumberone.jar , jarnumbertwo.jar" Yep, got that :-) >This way you don't have to put all the files into the same jar. Alas I >have heard that this doesn't work with all browsers. It works on IE >6.0 which is what I have tested with. I believe it's a problem with NS up to 4.x, I don't care about NS up to 4.x (mozilla rules the world muharharhar) so it's not much of an issue. Thanks for your help --- James Sleeman |