I have an Hello world applet,taken from book example.
HelloWorldApplet.java
import java.awt.*;
import javax.swing.*;
/**
* @version 1.22 2007-06-12
* @author Cay Horstmann
*/
public class HelloWorldApplet extends JApplet
{
public void init()
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
JLabel label = new JLabel("Hello, World applet", SwingConstants.CENTER);
add(label);
}
});
}
}
HelloWorldApplet.html
<html>
<body>
<applet code="HelloWorldApplet.class"
width="300" height="100">
</applet>
</body>
</html>
and while running it in my browsers I have following trouble.
But other non-applet html files (say javascript files) are successfully displayed in both firefox and internet explorer.
case FireFox version 6.0.2:
Firefox is abruptly getting closed whenever I execute this HelloWorldApplet.html in it.
Hence no output.
case InternetExplorer version 8:
Internet exp. is showing “this tab has been recovered” whenever I execute this HelloWorldApplet.html in it. Hence no output.
What I have done so far:
I tried out many links and followed their instructions. But, In Tools->Internet options->Advanced (tab) in internet explorer and Tools->Options in firefox I cannot see any find any checkboxes releated to java as they said.
Where the problem is:
They said if you cannot find any checkbox, then you must install JDK. But I already installed jdk 6.0.
In command-prompt,
C:\Users\MuthuGanapathy>java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode)
which says java is installed in my system.
So, what I have to do now to run applets in my browers?
Deploying applets with the
applettag is deprecated. It still may work, and the behaviour you experienced is in any case not acceptable, but you still should try the current methods for (multi browser) applet deployment as outlined here first: