The simplest of recommended way to deploy:
http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/runAppletFunction.html
// launch the Java 2D applet on JRE version 1.6.0 or higher with one parameter (fontSize)
<script src="http://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {code:'java2d.Java2DemoApplet.class',
archive:'http://java.sun.com/products/plugin/1.5.0/demos/plugin/jfc/Java2D/Java2Demo.jar',
width:710, height:540} ;
var parameters = {fontSize:16} ;
var version = '1.6' ;
deployJava.runApplet(attributes, parameters, version);
</script>
It works well. There are more complicated options, like using JNLP if you want to read or write on the client. But the above works for the basic scenario.
Lots of things “work” in Eclipse that don’t work online. From Eclipse, there are no restrictions about making use of your own file system or resources. But from the web, your computer is considered off limits, unless you use something like signing or JNLP.