Yahoo uses a big applet, but it's difficult to tell how the applet communicates to the server. Yahoo also used to offer a plain HTML version of the chatroom. Not sure if it still does.
The normal approach is sockets or RMI, but it is also possible to send HTTP requests from an applet back to the server. You can even send serialised java objects over this connection. Works quite well actually. The HTTP requests go through firewalls no problem (looks like normal browser traffic to the firewall), but it will require the applet to be signed (and new users have a big ugly security warning message, where they have to 'trust' the applet)
Plain HTML based chat rooms are possible. here's a good example:
http://chat.nme.com/ Look at the HTML headers to see how the refreshing works. Really this is not what the technology was intended for. Imagine what's happening in your webserver log files, when every chatter is refreshing so often. It's not a scaleable approach.
Also from past experience,
you should give careful consideration to whether you really want a chatroom on your site. If your site doesn't get many visitors, then a chatroom will only serve to underline that fact, since it will always be empty! Start by implementing discussion forums. If these start to get really lively (100s of users and 2 or 3 new posts every minute) then it's worth having a chatroom.