Nick
Nick

Reputation: 1499

Java Web Start (JNLP) advantages over Java Applet

What do you think are the advantages/disadvantages of a Java Web Start project against an Java Applet? We're trying to figure out what type we should use for our new application. We've already developed an Desktop App (JAR) and we're trying to make is useable from every machine, which has Java installed, without the need of installing it.

Any thoughts?

Upvotes: 1

Views: 2414

Answers (4)

Yuriy N.
Yuriy N.

Reputation: 6107

JNLP can (and in some cases should) be used with applet. Just finished integration of applet that read-write to user's file system.

Advantages of applet are obvious -- no installation on client machine.

Disadvantages:

  • not working in Chrome anymore;

  • additional configuration required -- each jar's manifest file must contain

       Permission: all-permissions
    

    line.

Upvotes: 0

Andrew Thompson
Andrew Thompson

Reputation: 168835

  1. Applet/browser/JRE interaction problems. If you don't know what I mean, don't even have an inkling (from lost hair) then deploying applets will be a steep learning curve.
  2. What does the browser bring to the deal? If the answer is JS interactivity, integration with an existing HTML based web app., or a few other related things, plenty. If not, then ask yourself what the advantage of deploying the app. wrapped in a browser window really is?
  3. JWS Jar caching and update is more reliable (and can be taken under programmatic control, if needed).
  4. The AppletContext provides some ability for an applet to interact with the environment, but the JNLP API goes beyond what the AC can achieve (mostly).
  5. General usability. These may or may not be a problem for your use-case.
    1. A free floating JWS deployed app. does not get closed when the browser gets closed, and does not suffer focus loss on tab change.
    2. If 3 applets each with controls are embedded in 1 page with links, what gets focus? Since Sun never bothered to specify what should happen (according to them) it has been different across JREs over time. Now it is common for the JRE to grab focus for the applets. If it does, it it generally impossible to use the keyboard (alone) to get to the links and other focusable elements in the web page.
    3. It is far easier to resize a desktop app.
    4. A desktop app. (with splash screen, desktop shortcut with icon etc.) can look much more professional.

Of course, it should be mentioned that the lines become blurred:

  1. Since JWS was introduced, it could launch applets
  2. Since the Plug-In 2 architecture JRE, JWS could launch applets that remained embedded in a web page.

..we're trying to make is useable from every machine, which has Java installed, without the need of installing it.

I would sweep aside the 'without the need of installing it' requirement of that since there is always the passage of time and the need for updating plug-ins. On that note, use deployJava.js to handle JRE minimum version checking. The script will either embed an applet or write a link to a JNLP launch file after checking minimum Java is available.

See also

The Stack Overflow info. pages for tags:

Upvotes: 3

Tom Hawtin - tackline
Tom Hawtin - tackline

Reputation: 147164

Since 6u10 the significant difference is down to an applet appearing in (and being able to interact with) a web page (possibly opening windows that don't necessarily interact very well with the browser window) and WebStart applications being separate from the web browser. WebStart applications will automatically get their own process, which may be significant from a memory usage point of view, at the cost of a slower warm start. Applets have access to javax.jnlp.* since 6u10.

Upvotes: 2

Hajo Thelen
Hajo Thelen

Reputation: 1135

I think web start is what you should use. As far as I know it allows you to start full blown java applications.

Upvotes: 0

Related Questions