Mr. Boy
Mr. Boy

Reputation: 63738

How to tell if a Java application was started by WebStart

Our app has 3 ways to launch...

  1. Applet in a web-page
  2. Desktop application
  3. WebStart

WebStart currently launches the applet but we prefer it to launch the desktop class instead. However, the desktop version expects all resources to be there already whereas WebStart should download resources like an applet.

Specific code in each case is not the problem, but figuring out which way the app was launched is... we don't want to try downloading content for the full desktop application.

Upvotes: 0

Views: 123

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168825

Some ideas:

  1. Set a property in the JNLP files to indicate it is JWS.
  2. Do a try/catch on loading one of the JNLP API classes. They will not be on the run-time class-path of the 'naked' desk-top app., but will for the apps. launched by JWS. Some examples of loading the JNLP API classes can be seen in these demos.

Upvotes: 1

Related Questions