Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is applet still important in java ?

 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, how common the developer still using applet for gui ? thank you !
 
Cay Horstmann
author
Ranch Hand
Posts: 172
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am afraid applets are not very common any longer. Sun is valiantly trying to push Java Web Start as an alternative, and I do like Web Start. There is also an effort from Sun to merge the applet and Web Start infrastructure. All of those are good things, but they move at a glacial speed.

And then there is, of course, the browser issue... How many people really want to install the Java Plug-in into IE?

It's too bad. I really like the concept of trying out an app on the web, and of having automatic updates with zero administration. With broadband, download issues aren't what they used to be. Java Web Start has a pretty cool security model that allows for some local file and print access, without requiring certificates. (End-user accepted certificates are evil: "Do you want to grant this application all permissions? Yes/No")

If you are just starting to plan your app, I'd suggest you implement it either as a web-based app, with an HTML interface, or as a Swing app. You can always deploy the Swing app with Web Start if you want internet delivery.

Cheers,

Cay
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cay,

I havent used Java Web Start before. I would like to know does the Web Start in fact is an improved version of Applet? or it is a different thing?

Nick
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, Java WebStart is innovation of Applet but JWS is easy to use and flexible.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java WebStart is innovation of Applet but JWS is easy to use and flexible.

In which aspects?

Nick
 
Cay Horstmann
author
Ranch Hand
Posts: 172
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JWS application doesn't run in a browser (but it can be launched
from a browser--this works through a MIME association)

However, just like an applet, the class files are cached, and there is a mechanism for downloading them again if the version has changed.

And, just like an applet, the JWS application runs under a security manager. There are some nifty improvements in the "sandbox", in particular, dialogs for loading and saving files, and for printing, that tell the user: "Hey, this is untrusted code wanting to do this specific thing, is that ok?"

Ideally, Sun would merge all the advantages, making JWS and applets essentially identical, except that an applet would run in a browser and a JWS app would run standalone. They say they are working on that, but it hasn't happened in Tiger.

Cheers,

Cay
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

A JWS application doesn't run in a browser (but it can be launched
from a browser--this works through a MIME association)

So, could I say, JWS is a kind of server application (which needs a server to contain it, or it is of a daemon) that interacts with applications via socket or MIME?

Nick
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicholas Cheung:

So, could I say, JWS is a kind of server application (which needs a server to contain it, or it is of a daemon) that interacts with applications via socket or MIME?

Nick


There a FAQ for JWS
http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/faq.html
 
Cay Horstmann
author
Ranch Hand
Posts: 172
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, JWS is not a server application. It consists of

- a client-side program launcher (javaws)
- a MIME association in the browser that associates a launch file (with
extension .jnlp) with javaws

You don't install anything on the server. You merely prepare the launch file and a JAR file. The launch file contains info where to find the jar file, what the app is called, and so on.

Your URL points to the launch file. The browser then says "whoa, a JNLP file, I don't know what to do with that, but wait, there is a helper app that does". So it calls javaws. The javaws app parses the launch file, fetches the JAR file (maybe from cache if there is no need to get a newer version), and launches your app under a security manager.

HTH,

Cay
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applet has about disappeared from meaningful work in the real world. I still see a few for cool image manipulation and games.

But they're alive and well in the corporate world - captive users with a tightly controlled workstation configuration, including security policies to let Java reach "out of the sandbox". We use them to communicate with other Windows apps and DLLs for things like 3270 emulation and computer telephony integration. We also use them to allow the server to push messages to the user, e.g. a pop-up window that warns users some other system is unavailable for an hour.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Cay.

Thus, JWS is just like the old-style Applet that we need to prepare a JAR, in addition with the launch file, then the JAR will be *shipped* to the caller when it is being invoked, isnt it?

Nick
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic