So presumably you didn't mention the iText jar in the archive attribute of your applet element?

Adam Pioro

Greenhorn

Posts: 8

posted 6 years ago

Ok now it works.
But now I have itext.jar in my program.jar and added second time as applet archive. Is there a way I could add something like archive="program/itext.jar" to avoid copying it twice?

Lester Burnham

Rancher

Posts: 1337

posted 6 years ago

But now I have itext.jar in my program.jar

That's not how jar files work - they can't be inside of other jar files if you expect to use the classes contained in them.

Adam Pioro

Greenhorn

Posts: 8

posted 6 years ago

Ok, but I added itext.jar as library in program.jar.

Lester Burnham

Rancher

Posts: 1337

posted 6 years ago

I'm not sure what you mean by that; can you elaborate?

Adam Pioro

Greenhorn

Posts: 8

posted 6 years ago

I have netbeans project and I have to add itext.jar as library there or it won't compile. But when I export whole project as program.jar and want to use it as applet I have to add itext.jar again as archive.

Lester Burnham

Rancher

Posts: 1337

posted 6 years ago

Whatever you do in NetBeans only concerns compilation; it has no bearing on what happens at runtime.

Adam Pioro

Greenhorn

Posts: 8

posted 6 years ago

Ok, but why my jar is 1mb larger when I add itext library? Those itext classes should be somewhere there in my program.jar I think.

Lester Burnham

Rancher

Posts: 1337

posted 6 years ago

It's possible NetBeans adds the iText jar file to your application's jar file; you can use the "jar" tool to find out what's in that file.

But that's not what NetBeans should be doing. The proper way to deploy extra jar files with an applet is by listing them as part of the archive attribute.