tags:

views:

223

answers:

7

What is the equivalent of a Java applet in .NET? Is it Silverlight? Is Java applet still widely in use?

+1  A: 

Silverlight is analagous to Java applets, but not really equivalent. In my experience, Java applets are being used less and less.

Steven Sudit
A: 

Either SilverLight, or an ActiveX control (still in use on some sites). Java applet will work only if a JVM is installed on the client machine.

Traveling Tech Guy
ActiveX controls are similar, but they're unmanaged, non-VM code, so they're scarrier than either Silverlight or Java applets.
Steven Sudit
SilverLight will only work if SilverLight is installed on the machine.
Tom Hawtin - tackline
Just as Java only works if Java is installed on the machine.
Spencer Ruport
Actually, you can develop a managed ActiveX control (see link) - but then you require the client to have the right FW installed (just like a JVM for applet).
Traveling Tech Guy
A: 

You'll see applets in use more in enterprises where tight control is maintained over installed Java versions and the browsers i.e. where the execution environment is constrained.

However I'm seeing fewer and fewer applet solutions even in these environments, especially with the rise of RIAs.

Brian Agnew
I personally removed a Java applet from an enterprise application a few years ago, replacing it with a little Javascript and one AJAX control. The result was at least as usable, and loaded much more quickly. I suspect this is a trend.
Steven Sudit
+1  A: 

Java applets are seriously out of vogue now - I haven't heard of any new apps using them in years. .NET has silverlight, which is more of a response to Flash than to Java applets.

In this day and age with JQuery and Mootools, MVC architecture, and Chrome's V8 engine, it might actually be better to just write your application in Javascript.

George Mauer
+1  A: 

Silverlight.

However, while Silverlight may be the new hotness, Java applets are still a lot more popular... most people have a JVM, but most do not appreciate a massive Silverlight install just to see your web page.

Now, many things that could only be reasonably done in Java or ActiveX are done in plain old JavaScript using new AJAX/DHTML libraries like JQuery and Ext JS. Example: Google Maps. Unless you're doing fancy graphics, try JavaScript first.

From a language perspective, there is a Java-like language available in .NET called J#, which can ease your pain if you are translating Java code to the .NET platform. It doesn't emulate the Java GUI libraries, etc. but at least emulates the syntax.

richardtallent
Why the downvote? If your going to vote down a comment at least explain why.
Knife-Action-Jesus
Silverlight install packages are not massive, they're slightly over 4Mb. Java only recently started to compete with Silverlight and Flash and their answer is called Java FX. J# is dead and not developed anymore, but there's an independent implementation of Java for .NET - IKVM (http://www.ikvm.net).
Filip Navara
@Knife-Action-Jesus: you haven't answered this question, I don't recall down-voting you elsewhere.@Filip: yes, *if* you happen to already have the current .NET framework. The 4MB is just the installer, it has dependencies it downloads separately. I was speaking from my experience downloading it on my Mac. Good point re IKVM.
richardtallent
Although Silverlight is new and might not catch on, Java applets are hardly popular. Likewise, J# is dead and shouldn't be mentioned. However, you're right that JS can do things that used to be within the domain of applets.
Steven Sudit
+1  A: 

Silverlight or XBAP. See the FAQ for differences.

Basically XBAP applications work on Windows only and run on the full .NET Framework. Silverlight on the other hand uses different core and set of libraries and is designed to be cross-platform.

Filip Navara
+1 for mentioning XBAP (WPF Browser Applications)... though there is the problem that they only work on Windows under IE7/FireFox.
Noldorin
+2  A: 

Java applets were "the new hot thing" in 1997, when Java 1.0 came out. After a few years, they became less and less popular, mainly because installing Java on a computer was a big hurdle for many people (you had to download the whole JRE, which was big, it took a long time to install and Java was not that fast at that time - so many people saw it as a slow, bloated thing).

Macromedia Flash (which became Adobe Flash later, ofcourse) had advantages over Java applets in this regard - the plug-in was quick and easy to install, and so it became the dominant thing for interactive multimedia stuff on the web.

Microsoft's Silverlight is meant to be a competitor for Flash and Sun's JavaFX.

JavaFX is Sun's technology that should make it easy to do Flash-like things on the Java virtual machine. If JavaFX becomes a success, then Java applets using JavaFX might become popular again.

Note that earlier this year, Sun released a completely rewritten Java browser plug-in which is quicker and easier to install than the old plug-in. On of the things Sun is working on is making it just as easy to install the Java plug-in as it is to install the Flash plug-in.

Jesper