在jsp页面中调用applet [英] Calling applet in a jsp page

查看:273
本文介绍了在jsp页面中调用applet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过javascript作为弹出窗口调用jsp中的applet。



i希望applet弹出来然后完成任务后应该会自动关闭。



这是我现在正在使用的代码,但是它将applet作为一个插件启动。



I want to call an applet in a jsp through javascript as a popup.

i want that the applet should come as pop up and then after completing its task it should close automatically.

This is the code i''m using right now but it starts the applet as a plugin.

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <script type="text/javascript" src="deployjava.js" ></script>
    <script>
        function showApplet()
        {
            var attributes = {code:'websample.WebcamApplet.class',
                archive:'websample.jar,core.jar, javacv.jar, javase.jar, jna.jar',
                width:640, height:480} ;
            var parameters = {fontSize:100} ;
            var version = '1.6' ;
            deployJava.runApplet(attributes, parameters, version);
           

            var searchPic;
            searchPic = new Image();
            searchPic.src = "E:/file.bmp";
            document.getElementById(0).src=searchPic.src;
         }
       
    </script>
    <body>
        <input type="button"  align="center" onclick="javascript:showApplet()" value="Show" >
        <img  id="0" height="480" width="640">

    </body>
</html>

推荐答案

您可以使用简单的applet标签来调用applet
you can use simple applet tag to call an applet


这篇关于在jsp页面中调用applet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆