I am having trouble embedding my applet into a webpage. I don’t think I’m doing it correctly.
* I have my html file in the same directory as my .class files
My main method is in CardApp class
This is my html code
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>TestJCardBet.html</title>
</head>
<body>
<applet codebase="" code="CardApp.class" height="400" width="500"></applet>
</body>
</html>
Making applets work across a wide range of browsers is surprisingly hard. The tags weren’t properly standardized in the early days, so Internet Explorer and Mozilla went separate directions.
Sun developed a generic JavaScript to handle all the specific browser quirks, so that you don’t have to worry about browser compatibility.
Add this to your
<head>section:And this to
<body>section:See Java™ Rich Internet Applications Deployment Advice for a detailed explanation of the script and all the possible options.