Applet class is not loading in a JSP

183 Views Asked by At

I'm working on maven web application with JSP and Servlets. I have a href which has a applet class call which loads my applet success fully from certain Servlet but on my windows only. Now I want to load this into client browser wherever this link is clicked from remote machine's IP. Please help me on this it should be loaded on client browser from HTML or JSP.

This is my class in my Java:

package com.enidiris.util;

import javax.swing.JApplet;
import javax.swing.SwingUtilities;

public class AppletIris extends JApplet {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    private boolean inAnApplet = true;

    public AppletIris() {
        this(true);
    }

    public AppletIris(boolean inAnApplet) {
        this.inAnApplet = inAnApplet;
        if (inAnApplet) {
            getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
        }
    }

    public void init() {

        try {

            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                    createGUI();
                }
            });

        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public void createGUI() {

        MainPanel mainPanel = new MainPanel();

        getContentPane().add(mainPanel);

    }

}

This is my HTML in same web application but nothing says in console of browsers, not even loading applet.

webapp/ register.jsp

<body onload="checkSession();">
    <jsp:plugin type="applet"  name="AppletIris" code="com.enidiris.util.AppletIris"  width="950"  height="650" hspace="0"  vspace="0" codebase="." >
        </jsp:plugin>
<!--     <object codetype="application/java" classid="java:AppletIris.class" -->
<!--    archive="enidiris-applet.jar" width="740" height="400"></object> -->
</body>
0

There are 0 best solutions below