Skip to main content

Java applets not viable for this application?

Posted by joconner on February 22, 2008 at 10:10 AM PST

I've been working with a company that creates a chat system that helps companies sell more of their products online. The backend is all Java, complete with Spring, servlets...all good Java stuff. The frontend is...well, it's Flash.

Preferring Java everywhere when possible, I asked about the Flash choice on the customer-facing app -- the actual chat client. The conversation went something like this:

John:Wow, this product uses Java everywhere except on the front, where the customer actually interacts with it. Why choose Flash there?

Dev mgr:Well, Flash was just easy. It was simple to use for such a simple UI too.

John: I see, but it's pretty easy to do that chat UI in Java too. Swing's layout managers are easy now, particularly if you use an IDE like NetBeans to layout the UI.

Dev mgr: That may be true, but the choice is based on more than just ease of creating the UI.

John: Yeah? So what's that?

Dev mgr: Flash is on every client browser. We don't have to install the runtime.

John: Java should be there too, right? Most PC manufacturers include it.

Dev mgr: Maybe, but we know Flash will be there. Flash is all over the web, and chances are that a customer has the runtime already. If they don't, the download and install is fast and easy.

John: OK, but Java will also install easily.

Dev mgr: But Java takes so long to install. It's too big.

John: I don't know if that's so true anymore. There's been a lot of work to make the runtime smaller and more compartmental. So you only download what you need.

Dev mgr: What we need is something very, very simple. A very simple UI with simple functionality to relay chat text. Flash does the job well.

The conversation continued...but I didn't get too far. Maybe Flash does do applets better than Java? Working with Sun for so long, I just naturally imagined that Java was everywhere and that everyone else loved it too. I've always been able to make things work...but apparently not everyone else has. The download size never bothered me...but it does bother some others.

Additionally, I find that perception is as important as reality. So what if Java is now faster, leaner, and great working within browsers? Somehow it doesn't matter. The old perception is still out there -- that it's slow, huge, and difficult to work with in a browser. It's amazing to find out that some just don't see Java as their solution in that space anymore.

I called a few friends who put together consumer-oriented websites. They use Flash too. What about Java? Sure...all on the back end business logic. But what about applications that the customer will use? If they're embedded in the browser, they're using Flash. Wow.

So, how would you approach this? What does the Java community need to do to fight back old perceptions? Why is Flash so much more popular in browser based applications? And how can we get Java there instead?

Related Topics >>

Comments

Acrobat Reader has become very unresponsive, at least to me. It is more and more bloated with functions I don't want. The result is that it take ages to load a document now. I agree that after it has started, loading others documents is reasonably fast, but you now have to think twice before double-clicking on a PDF file...

- Java has a great advantage over Flash - Client and Server side can be programmed in one language. You can debug application on the client and server side using same IDE. It is very easy to understand which Java object on the server is transformed to which object on the client. Actually they are same! Unfortunately an addition of new language like in JavaFX eliminates this advantage :(
- A "Mini Java" edition is definitely needed for desktops
- Probably Swing/AWT should be replaced by some other GUI toolkit in "Mini Java". Swing is about 10 years old technology and pulling it further is too hard task.
- Multimedia support is MUST
- Java server side must also become more lightweight. Not all hosting providers have Java hosting while all of them have PHP. Java hosting is ~5 times more expensive than PHP. (BTW It's good that Sun purchase MySQL :)
Conclusion
At the moment there is no such integrated technology in the world that solved all the mentioned issues in one pack. So Sun still have some chances to make it. You should do it fast while Google haven't done it with Android. It's only now positioned as "mobile" toolkit while in future - who knows... :)

Well, yes it's all true. Flash is way ahead on the acceptance of programmers. I personally have the opinion, that it would be sometimes easier to use applets on the programming side when the programs are becoming bigger. Flash gives you a head start to have some glossy buttons zooming in, but then you have a hard time creating UI that does standard behaviour. There are so many flash applets, with groovy looking Text fields, but then try to paste a value or select the text with the mouse etc and you will get funky results. A friend of mine is a flex fanatic and his apps look fantastic, but 75% of his work goes into making the applets behave like real applications.

Swing on the other hand has a horrible learning curve and when you are finished with your work, you still have a pretty standard look and feel or even worse... oceans baby blue. I still wish there would be something like .css to pep up my Buttons by just choosing a theme from a menu that i can modify... By the way, what happened to "Synth"?

I think JavaFX could still rock. But there has to be a customizable UI-LookAndFeel (perhaps with Painters or a "synthesized" version of the Substance LAF). What use are the best Widgets if they don't match the overall color and style of the surrounding Webpage. Perhaps the place for JavaFX is not the browser at all, but something completely new (kind of a sencond Desktop for "not so big applications" like the Dashboard)? Future will tell...

given that we are enjoying megabit broadband and not 14.4k sushing modems anymore, it's the perception that "java is too big and slow to download" outdated? not to mention the so-called "consumer jre" that is coming out :) i suppose it takes most managers a decade to unlearn something they heard once in a meeting in a 90s ;)

facebook uses java applet to upload photo's, and facebook has 70million users...

Java and Flash cater to different UI development needs. Java applets are for desktopish applications, i.e. user interfaces with Lists, combo boxes, trees, typical data entry applications. Flash also have these desktop widgets, but main focus in flash is in animation, rich graphics, ability to embed audio/video content, Ajax capabilities. Flash is more geared towards cool factor. UIs developed by these two look completely different. Can a swing applet ever be as cool as a flash application? I have a different question, can java ever gain acceptance on client (not only as applets). Swing have perception problems as a slow ware and real problems at platform and API level. I haven't worked on swing from java 5, may be its improved somewhat, even if it is improved many enterprises and developers have bitter memories with Swing, they are difficult to forget.

Applets do have a negative perception. They have the potential to remain viable but a number of issues need to be resolved. I wrote about this topic a year ago on java.net:

http://weblogs.java.net/blog/gkbrown/archive/2007/03/reinventing_the.html

Java has a lot of quality issues on the client.

I made a small simple fullscreen app that just draws a happy face. My wife can't run it on her work computer - it just hard crashes - has to be a bug in the JVM, since I use no native code. She is running Windows XP on a typical desktop system.

On Linux currently all Java apps with a UI are broken. That's right ALL of them. The current Java 6u4 has a locking bug that makes it incompatible with the X server. No end user is going to go through the trouble of figuring out the magic environment variable (ALLOWSLOPPYLOCK or some such thing) that can be used to work around it. Well maybe they are because they are running Linux so they are used to having to tweak everything to get it to work.. but the point is that it is a huge bug that makes Java on Linux just plain broken. If you go to a web site with an applet you just see nothing where the applet should be. If you try to start a Java app that has a GUI you just get nothing.

If it isn't uncommon to have Java crash on the most popular OS, not show any UI on Linux, and not even be available (w.r.t Java 6) on Macs... well the situation isn't very good is it?

Java applets have a fighting chance, still. Flash dominance can be attacked on several fronts. For one thing, Flash was not designed with security in mind. It was extended way past what initial container was capable of. I'm not sure what the state of Flash is, but the architectural focus of initial design should offer Java a benefit over Flash. Action item: figure out how Flash is poorer at security and privacy protection. Other thing, Flash makes it possible to create really obnoxious, in-your-face, poor taste ads (that also are big files to download). This leads to some end-users blocking Flash. If Flash blocking practice was more widespread, that would naturally help Java. Action item: create more ugly ads in flies of no less than 300k :) just kidding.

I've documented all the usability problems I found, even on Java 6 Update N: http://forums.java.net/jive/thread.jspa?threadID=35554&tstart=15

I welcome your feedback.

It's all about responsiveness. Flash is very quick to come alive and does have a lot of nice features. Applets? LOL After waiting for the JRE to come up and and watching the java splash while it loads the applet code...are you kidding me? At that point, as a user, I've probably hit the back button which sometimes hangs the browser (firefox). Applets are probably the last client side technology I would use.

Sun on java.com is also using flash :-)

Sometimes you don't have choce Flash is fast on loading and much more easier for graphics and UI but sometimes JAVA applet is the only solution
here in my case i needed to display jasper report 's report in Web based ERP system the client needed options to save local copy of the report and export to different formats.
having not tried new jasper report for flex i have no options than to use applet.
One question that i face from my Boss is why not deploy whole ERP as an Java applet rather than a web based one if JAVA(full jre1.6) needs to be there for displaying the report

In general, as noted by pulihora, Applets and Flash serve different purposes. I find that when flash is used to do "normal" UI (e.g. buttons, lists etc) it behaves badly - no support for mouse wheel for example (at least on OS X). Doing cool stuff in swing is not easy but not overly hard, and anyway, when doing a day-to-day interface, too much visual effects are just, well, too much. All those flashy UIs remind me of the early days of powerpoint, when people just used animated transitions all the time just for the sake of it. IMHO, the big question is not how applets measure up against flash, but against FLEX/AIR and MS's silverlight. The answer? I have no idea.

Though Java technology made a great advance, the main problems are the same as 10 years before: 1. JRE is not packaged with a standard desktop solution that most of users have. Sorry, I respect the arguments of the author but I don't accept them. If only 20% of users may access my public service I will loose 4/5 of possible income. I mean 20% of users that already have JRE installed or that HAVE A GREAT DESIRE to download and install a THIRD-PARTY PLUGIN only for access my page. This is the reason because applets are not used not only en internet but also in enterprise-specific solutions with limited number of clients. 2. Java startup time is large and a page freezes during applet initialization up to 10s. Well, it may be resolved by JRE preloading. But it is annoying behaviour for modern users got used to fast webs.

Java 6 Update N is what is needed to fight back. The disconnect is that checking the source for Java 6 Update N in to hg is not the same victory as having it prebundled with a new machine. IMHO, Java camp does all of the technical comparison using Java 6 Update N vs. Released product X and the end user compares it to the version of java installed when the purchased the computer (because the date of purchase is the last time they updated). I doubt most end users could tell you the size of the JRE, quicktime, flash, etc. They don't care. The end user cares about how much time they forced to wait (startup and responsiveness). The end user wants computer to do things for them and not have to do things for the computer (stop asking me questions installer/updater).

Flash is less than 2 MB, but I think that saying that JRE is too huge to download is not true anymore, comparing with other web apps. The 6.0 JRE is 16 MB, less than Acrobat Reader (22 MB), Quicktime (19 MB), and .NET framework 2.0 (22 MB) for example. Some would say that these come out of the box with the PC but this is not the case. You often have to download full versions to update these apps.

Well, Flash is de facto the ubiquitous platform for applets on the web. You can safely presume that all browsers have it, but you cannot presume that all PCs come with Java pre-installed. (All the Dell machines at the World Health Organization, where I work, for example did -not- come with a Java VM on them.) And Flash has a smaller footprint than Java, but what's even more important: You get -designers- to use it, too, nut only software developers who usually are not very good a designing user interfaces. Everybody sees Java as a server-only platform nowadays. It failed on the desktop, and it failed in the browser.

I'm not so drastic - in the latest ten years I've always seen applets deployed successfully. The point is that you deploy them with no major issues if you have a somewhat "controlled" environment, e.g. the clients of an organization. If you're targeting casual end users, Adobe stuff installs better and it's lighter.

I don't think that it's too late - after all, one years ago people said that it was too late even for NetBeans, but this proved to be not true, so maybe we can recover. It's true that Sun has been sleeping on the browser for too long.

It's also to be said that it's not true that the Java 6 Update N will install only the required parts. It will install the required part _first_, offering a better user experience and starting the applet first, but it will in any case install the whole JRE, which is actually bigger than the Adobe runtime. In a world of fast network as today, I don't see this as a real problem, but again people might have a false perception about it.

I would echo what johnyboyd says, and even say it a bit stronger ... I'm not at all convinced that your manager friend's "old perceptions" are invalid.

I speak from the perspective of someone responsible for maintaining and enhancing client/server app at work where the client side is all applet. I would definitely not recommend client-side applet for any new project.

(I've got no background with flash/flex).

Yup ... since you've been within Sun for so long, it might be natural that you're less in touch with the outside use of client-side Java. I've rarely seen my customers accept browser-side Java. Flash/Flex/DHTML is much more accepted - for valid reasons and some invalid perceptions. Flash is defintely more widespread than Java on the browser. It's a much easier install and UI development (- I'm referring to Flex here) is easier as well. Of course the earlier preceptions of Java - slow, bloated and non-uniformity in browserland still remain. JavaFX might help here - but IMHO it's too late. Flex and MS Silverlight are way ahead ... Sun had the opportunity, but ignored the browser for too long. Witness Flex, Ajax and even GWT .. -jb

I agree with mediarazzo. I don't think that Java would be able to compete with Silver Light or Adobe Air in browser space. Looks at the runtime sizes for both. There is no way that we can have Java runtime with that size. Instead of spending more effort on fixing the core issues, a lot of effort is being spent on FX script and 'Look & feel'. We don't need a script language to fight back. Applets are good enough if they work well and fast. Is FX script better than Swing ? I don't think so , at least not on the performance side. After all those years, how many Java desktop applications have we seen ? If we don't see many Swing applications, what make Sun think that FX script would have a market place ? Look at the last update on JMF makes me wonder if Sun is really serious on coming back to RIA space. How can we go RIA without Multimedia support ? Take look at Android, it has a very good multimedia support from day one and it's getting better. I think that J2ME is going to lose market to Android in mobile area. I wonder if we are going to see a desktop runtime for Android some day. Sun needs to focus on the right areas, gets things done quick , get things done right and sticks with them. If Sun had kept JMF development for all those years, we would have had a good multimedia support for Java today. Those issues have been discussed over and over recently. Does Sun actually listen ?

Why is Flash so much more popular in browser based applications? Because back in the late nineties/early 2000s, when Sun was running away from the desktop, Macromedia was busy cutting distribution deals with every computer maker on the planet.

The biggest problem applets have today relates to Suns low credibility in the browser/desktop world (due to the problems already stated above). And it certainly won't be easy to repair the damage. Flash/Flex/AJAX developers, people currently knee deep in browser based applications, have no use for applets. Java developers, most of whom work comfortably on the server side, would have to wage an uphill fight. And for what? Sun has yet to provide a compelling reason *to* fight, IMHO.

I've been on a number of projects in past that used applets, Swing and Java Media Framework and really enjoyed working in those areas. It's what I'd prefer if given a choice. However, I've also fought a number of battles over their usage and the battle wasn't always successful.

Sun can spend all the time it wants developing a better installer or building a new scripting language. But what good is a new installer if clients want to deploy applications that don't require installation? What good is a new scripting language if the language isn't any easier or provides more functionality than what already exists?

And what about multimedia?

I think it's safe to say that applets will not be making a comeback. I'd love to be wrong about that but the marketplace has made a clear choice. And until Sun shows some ability to make the sale, very little is going to change.

My company has also had to make the same decision. We ship two products. The first is an enterprise desktop app -> we use Java/Swing and even ship a web start option -> works great. Web start rocks. But there is a customer (as in mum and pops) app that is Flash. Why ? It just works, on every computer. Support is easier. Java is more powerful, and in our experience its easy to get working, but you can get support issues. I develop in both. I prefer Java -> its much easier to extend Java Swing etc, and you can do native integration. Flash can't do desktop well, it does "browser" well. That means it looks at a lot of usage scenarios and stream lines it for a very narrow set of use cases. That is why it works. Java is very generic, which is its power. Flash focuses on a verticle. Moving outside of that verticle is very hard. But it nailed it. What should sun do -> take JRE Update N, and then "package it" for a verticle -> ie. the applet class needs more "interaction" and smarts. ie. you should be able to right click on an applet class and set permissions etc. Not edit a policy file. The Applet needs to change focus from "an api" to "a product used by consumer, that exposes java functionality". Dumb it down. Java/FX and all the great swing stuff is great, but focus nees to be put on the Applet as a "runtime container", not an API. Add multi-media. NOW. would also help. And when you add it, don't just make it another API, allow users to manage it with a right click over the applet.

@swpalmer: Java6 update N but build 4 is not current anymore, and since a long time: try build 12 ;-) And as for the crash on the XP box of your wife at work, try to look at her PC configuration. I'm using Java on all different kinds of Windows boxes (not always XP), and I had never any problem with the non native parts of applications, even when executing the JRE and the Java program from a CD. You might have set something like sun.java2d.opengl true, for a PC whose OpenGL drivers are broken.

I couldn't agree more with that Dev manager. What he said are not old perceptions. They are true statements. I recently bought 3 laptops. None of them has Java runtime installed. As a Java developer, I hate to say that I'm thinking about going with Flex for desktop and web applications. Adobe just released Adobe Air and it looks very nice. FX script is not going to help Java to compete with Flex without a fast , small and easy-to-deploy runtime. We still don't know how well that 'Update N' will help for deployment . And then it comes to the support for multimedia. Lack of good support for multimedia is an issue with Swing for RIAs.

One observation I have made about *my* personal web use: I am using a lot flash to get annoyed with comercial, a few games. The two serious application I uses, particular since it involves security does use java applets: My netbank and the national gaming company. The solution works very well. I think applets can be the right tool for some apps.

give more attention and resources on Applets give more attention and resources on Applets give more attention and resources on Applets Client side we have Applets, server side we have Servlets. Isn't that so sweet. Azlan

Swing is the best for developing rich desktop applications that can be installed/updated by users via Java Web Start in controlled environments, such as Intranets, where you can ensure the right version of Java is installed. In the vast Internet world, you cannot assume your users have the right version of Java or the ability to install it.