Tweet
To view it in a web browser , use BlueJ to directly open as a webpage or click on the saved applet code with .html extension.
To see the html code of the webpage open the html file with an editor.
It will display the following code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This file automatically generated by BlueJ Java Development -->
<!-- Environment. It is regenerated automatically each time the -->
<!-- applet is run. Any manual changes made to file will be lost -->
<!-- when the applet is next run inside BlueJ. Save into a -->
<!-- directory outside of the package directory if you want to -->
<!-- preserve this file. -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ParamDemo Applet</title>
</head>
<body>
<h1>ParamDemo Applet</h1>
<hr>
<applet code="ParamDemo.class"
width=500
height=500
codebase="/home/lahaul/Desktop/Java2"
archive="file:/usr/share/bluej/bluejcore.jar,file:/usr/share/bluej/junit.jar,file:/home/lahaul/Desktop/Java2/"
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
>
Your browser is ignoring the <APPLET> tag!
</applet>
<hr>
</body>
</html>
Note : HTML5 does not support applet tag.
Save the applet code with a .html extension or use BlueJ to save as a HTML page.