The applet source code is never in your html page. The HTML page contains only a reference to the applet class that is residing on the server side. When the HTML page is loaded on to the client browser the HTML interpreter interprets each and every tag. when it finds the applet tag it requests the web server to serve the same class file which is referenced in the applet code attribute.
If this file is available on the specified location then it is served. Once this class file is loaded on to the client side. The browser loads the Java runtime which normally comes inbuilt with various browsers. This Java runtime works exactly in the same as the Java interpreter "java" . It executes that class. So there is no question of having the code in HTML page.