Re: Applets and Inner class problems
From: Alex Hunsley (lard_at_tardis.ed.ac.molar.uk)
Date: 12/12/03
- Next message: clvrmnky: "Re: File.mkdirs on SMP Linux"
- Previous message: Alex Hunsley: "Re: Applets and Inner class problems"
- In reply to: Alex Hunsley: "Re: Applets and Inner class problems"
- Next in thread: Chabonga: "Re: Applets and Inner class problems"
- Reply: Chabonga: "Re: Applets and Inner class problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 12 Dec 2003 17:30:37 +0000
Alex Hunsley wrote:
> Chabonga wrote:
>
>> I feel really dumb right about now. I have adapted an example from
>> sun's site to suit my needs for an image pan and zoom tool. In
>> eclipse, the applet runs fine, given the proper parameters are passed.
>> When I embed the applet in a html page, the JRE console gives me
>> these errors:
>>
>> java.lang.NoClassDefFoundError: imagezoom$DrawingPane
>> at java.lang.Class.getDeclaredConstructors0(Native Method)
>> at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
>> at java.lang.Class.getConstructor0(Unknown Source)
>> .
>> .
>> .
>>
>> The applet tag I am using looks like:
>> <applet code="imagezoom.class" width="300" height="300">
>> <param name="name" value="imagezoom.class">
>> <param name="imagename" value="D0001636.jpg">
>> <param name="path" value="images">
>> Sorry, your browser can't display applets. </applet>
>>
>> I have tried various modifications of this with no luck.
>>
>> DrawingPane is an inner class of imagezoom, the source code of which
>> looks like:
>>
>> Can anyone see what I am doing wrong? TIA,
>>
>> Trev
>
>
> Internal classes get compiled to seperate class file. In this case you
> will end up with a class file called imagezoom$DrawingPane.class as well
> as one called imagezoom.class. Why don't you put all your classes
> (including the inner class file imagezoom$DrawingPane) in a jar, and
> upload that instead. Then you'd reference it as:
>
> <applet code="imagezoom.class" archive="imagezoom.jar" width="300"
> height="300">
>
> Note that in the above I have added an archive parameter for specifying
> your jar!
>
>
> alex
P.S. there's a useful trail at sun about jars and applets:
http://java.sun.com/docs/books/tutorial/post1.0/whatsnew/jar.html
- Next message: clvrmnky: "Re: File.mkdirs on SMP Linux"
- Previous message: Alex Hunsley: "Re: Applets and Inner class problems"
- In reply to: Alex Hunsley: "Re: Applets and Inner class problems"
- Next in thread: Chabonga: "Re: Applets and Inner class problems"
- Reply: Chabonga: "Re: Applets and Inner class problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|