How to integrate java applets into web applications

Nancy Mooree :

Am testing out how to call out java applets into a web aplication

when I run the code below via javac AppletCode.java at command prompt it runs

import java.applet.Applet;
import java.awt.Graphics;
public class AppletCode extends Applet {
    public void paint(Graphics g) {
        g.drawString("Hello World!", 50, 25);
    }
}

Here is my issue: when I call the applet class via html code below nothing shows up. please what could be the problem Note that both Java class and html file are in the same folder

<html>

<head>
    <TITLE> Testing applet on web </TITLE>
</head>

<body>
    Result:
    <applet code="AppletCode.class" width="150" height="125"></applet>
</body>

</html>
Nilanka Manoj :

New browsers do not support that : https://java.com/en/download/help/enable_browser.xml

Chrome browser versions 42 and above. Starting with Chrome version 42, Chrome has disabled the standard way in which browsers support plugins.

Firefox has removed NPAPI plugin support, and therefore Java Plugin cannot be enabled in Firefox browser version 52 and above.

It seems like client devices should have older versions.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=317198&siteId=1