This … was … a … pain. Sure, most forum commenters said that to make this work, you will have to have the attribute Trusted-Library: true in the manifest of your jars and third party jars that your applet uses.

However, that is only half of what needs to be done. Even though all my third party libraries had that attribute in the manifest and signed them I never figured it out until so many days later.

When the Javascript call was made, the annoying warning sign pops up.

So what is the solution?

  1. Make sure all your jars have Trusted-Library: true in the manifest.
  2. Inside your main jar, add another attribute Codebase: *
  3. Sign all your jars using the same certificate

That is it! Problem solved!

I think it started with Java 1.6 that a JNLP jar file was included that can let you run a Java web start application or applet in a single instance.

Through the SingleInstanceService class, you application or applet will be able to detect if another instance is run when it is called from a JNLP.

I have not tried this with an applet that is run from an <APPLET> tag but I tested this in an applet if it is called from a JNLP.

Simply implement SingleInstanceListener from your class and initialize it with this code:

And in the newActivation() method, you can put in a message prompt that looks something like this:

Easy, right?

By the way, if this code is run within an IDE, it will return an exception. This will have to be run from a JNLP in order for it to work.

Related Posts Plugin for WordPress, Blogger...