Yes, that is possible.
http://java.sun.com/docs/books/tutorial/networking/index.html
The problem is that most browsers won’t let you connect to any host, or even another port than the website’s port (80) to connect to on the host itself. So if you do not have a servlet, you need to write some php code that acts as a proxy between the website with the applet and the ‘actual game server’.
That’s not too hard, but in the applet you’ll need to send/receive data wrapped in the HTTP protocol due to the PHP proxy.
So there you have it… learning networking is hard enough, and creating that proxy only adds to the dificulty.
Creating a standalone Java application will allow you to connect to any host, so you might want to go that route.