Applets
Why no applets?
Check out Java Web Start or OpenLaszlo for an excellent, open-source way to generate Flash applets, AJAX content, and other mechanisms for rich Internet application deployment.
Sun has a trail for applets.
We say this as we are pragmatic, work as professionals and try to enhance the use of Java.
That said;
Applets are a valid way of deploying code to a browser. The problem is that not all browsers support applets the same way, and support is sketchy even across different versions or revisions of the same browser. As a result, you will wind up spending more time troubleshooting these browser and environmental issues than coding or dealing with the Java portions of the code.
Some history - from Wikipedia
A Java applet is an applet delivered in the form of Java bytecode. Java applets can run in a Web browser using a Java Virtual Machine (JVM), or in Sun's AppletViewer, a stand-alone tool for testing applets. Java applets were introduced in the first version of the Java language in 1995. Java applets are usually written in the Java programming language but they can also be written in other languages that compile to Java bytecode such as Jython.
Where did it start going wrong?
From Wikipedia and most of ##java......
Sun has made a considerable effort to ensure compatibility is maintained between Java versions as they evolve. For example, Microsoft's Internet Explorer, the most popular web browser since the late 1990s, used to ship with Microsoft's own JVM as the default. The MSJVM had some extra non-Java features added which, if used, would prevent MSJVM applets from running on Sun's Java (but not the other way round). Sun sued for breach of trademark, as the point of Java was that there should be no proprietary extensions and that code should work everywhere. Development of MSJVM was frozen by a legal settlement, leaving many users with an extremely outdated Java virtual machine. Later, in October 2001, MS stopped including Java with Windows, and for some years it has been left to the computer manufacturers to ship Java independently of the OS. Most new machines now ship with official Sun Java.
Some browsers (notably Netscape) do not do a good job of handling height=100% on applets which makes it difficult to make an applet fill most of the browser window (JavaScript can, with difficulty, be used for this). Having the applet create its own main window is not a good solution either, as this leaves the browser window as a largely useless extra window and leads to a large chance of the applet being terminated unintentionally by the user closing the parent browser window.
[edit]
What is the alternative?
Check out Java Web Start, a technology from Sun that lets you deploy an application using the web browser standard mechanisms for content pull from a web server, and the plug-in mechanism for execution. This is a lot cleaner than the applet system and supported across all major (and most minor) web browsers.
A Java Web Start application is really just a stand-alone Java application that's deployed with a JNLP XML file; the JNLP file tells the browser how to deal with your application, security, file access, and other parameters in a safe and portable way, and without the handicaps associated with applet deployment.
My teacher/boss/other misguided person insists that I embed a component in the web page; can I use an applet then?
Sure... we just recommend that you use a Flash applet instead of a Java applet. Flash support for embedded content is much more uniform than Java. The Flash run-time is more suitable for the kinds of things that you can do with a browser and web server interaction. They are more limited than Java Web Start but they are better designed for browser-based applications.