Flash and Javascript/Ajax share many of the same capabilities (and actually had the same syntax as well, in Actionscript 1).
Flash is widely available but a good rule of thumb is: if it can be done with javascript with good performance then use javascript. I would use Flash for drawing vector images, and manipulating audio/graphics. Flash 8 added some great image manipulation capabilities (e.g. you can specify matrix transformations to produce your own image effects/filters in real time).
Multimedia in general should be done with Flash (or Silverlight when it gets there).
In addition Flash has sockets - a very valuable resource. With flash sockets you can implement a stateful connection (i.e. where as in Ajax you have to query the server every x seconds, in Flash you can create a socket connection and have the server send data to the client whenever it needs to, there's two-way communication). There are some reverse-ajax frameworks that enable you to implement more socket-like connections in ajax - but these have some drawbacks.
Java applets i would only use for some extreme needs (such as accessing the user's file system, hardware devices, or for cross-domain socket connections) because the JRE is a big download, and because even for some quite simple tasks you end up having to sign your JAR's, which generates certificate prompts and security warnings. Also two-way java to javascript communication is not the easiest thing to implement - same goes for dynamically adding java applets to html pages with javascript. Finally, there isn't great compatibility between JRE versions - something that works in 1.4.1 does not always work in 1.5 (from my experience).