Which approach is better?
- Having jsp/HTML based web application which allows you to traverse web pages in the browser.
- An applet based web application which opens up a Swing applet screen?
Which approach is better?
That depends on your criteria. Personally, I prefer HTML based web applications because they are easier for search engines to index, easier to bookmark links into, and better supported across multiple browsers.
An applet will let you do fancy stuff within the browser, without needing to go back to the server as much (although you can get most of the way there with JavaScript/DOM these days).
Applet startup times are pretty slow; there are also reports that Sun is stepping away from swing in favor of JavaFX. While the libraries will probably never leave java, they will tend to look pretty old and dated- I think that most swing apps tend to look pretty awful.
I'd definately recommend HTML / Ajax- they will work in more places and on more browsers.
The correct answer is "insufficient information", and "better" lacks criteria. However, the fact that you are asking the question the way you do makes me believe that #1 is probably "better" for you. While #2 provides much more programmed control, there are many issues. If you need the control, then #2, but check browser compatibility, load time, development time, Java experience. If you need control mostly for graphics, consider Flash.
I've been doing web applications for 5 years now, and I'm completely sick and tired of HTML / JavaScript. The development of tools has been lackluster at best, and the fragmentation of implementations has only continued to grow.
At the same time, Flash applets have profusely multiplied. More and more people are moving to ActionScript and Flash. Silverlight, the Microsoft Applet, has comeout with mild fan-fare. The next Java release has promised faster startup times to support applet loading.
I've also noticed that development on HTML / Javascript / (insert serverside implementation here) is anywhere from 2-4 times slower than in a single language / single ide environment. AJAX has yet to save the planet, and has only created a huge number of implementations to choose between, and then in the end feel like you chose the wrong one.
My vote is strongly in the Applet Corner.
As many others have said, your question doesn't have enough information to provide an answer.
As a user however, I much prefer html/javascript/ajax sites over applets or flash.
One suggestion for you is to check out Google Web Toolkit. It lets you write in Java and compile to javascript. A pretty nifty tool actually.
HTML/JavaScript is the bane of every webapp developer, but they get the job done, in most cases. Webapps are nearly free of limitations, and can mimic a great deal of what you can easily achieve with a simple Swing applet. Of course, applets are also confined to their little sandbox within the browser's memory space, and this can hinder usability.
Having said all this, there are functions that a webapp simply won't be able to do as efficiently or successfully as an applet, mostly dealing with non-conventional graphic elements on the screen.
Bottom line, let your requirements (and the limitations of each option) lead you to the right answer for you.
Yuval =8-)
Java applets ARE solid, stable, supported technology, even at the end of the year 2008. There are many things that could be better accomplished by using applets instead of AJAX or Flash/Flex - for instance, displaying MANY interactive objects or other interactive graphics-intensive tasks. Why not flash or flex? Well, it depends, Java (and inherently Java Applets) has many great libraries that could be reused - for example, in context of graphics, Apache Batik comes into mind first.
I think that applets are so loathed technology mainly because of bad deployment. Read this article (including the other parts) for explanation if interested.
Of course, applets have well-known downsides. The most obvious one - it is not installed on an average Windows-based computer by default. Firstly, that is not convenient for your visitor to install JRE with browser plugin and, moreover, your service will not be accessible by user that has a (in Windows terms) "limited" account.
But, at last answering your question: it depends on your needs. Ask yourself whether you CAN build needed service using AJAX, if not, choose between Silverlight, Flash/Flex or, yes, Applets.