【问题标题】:Embedding Java Applet into html [duplicate]将Java Applet嵌入到html中[重复]
【发布时间】:2012-12-28 17:15:32
【问题描述】:

可能重复:
Embedding Java Applet into .html file

我已经用 Google 搜索并进行了研究,但我仍然不明白我哪里出错了。

我的程序包含三个类:myFramemyRightPanelcalculationEnginemyFrame 是扩展 JApplet 的类,我这样做了:

public class myFrame extends JApplet implements ActionListener {
      //bunch of things here
}

myRightPanel 类和calculationEngine 类由myFrame 实例化和使用。整个代码在 Eclipse 的小程序查看器中运行良好。我面临的麻烦是将其嵌入到 html 中。我这样做了,但它不起作用。

<!DOCTYPE html>
   <html>    
      <body>
         <marquee>
            <h1> Ghun Chaatlo </h1></marquee>
            <applet code="myFrame.class" height="800" width= "1200"> 
            </applet>
        </body>
   </html>

所有文件:.html 和 .class 文件位于同一目录中。但是当我运行 html 时,它不显示小程序。 IDK 为什么?请帮忙。

【问题讨论】:

标签: java html japplet


【解决方案1】:

看来您使用的是 html5。这是将 Java 小程序添加到 HTML5 文档的最佳方法

<object type="application/x-java-applet" height="300" width="550">
  <param name="code" value="Sample" />
  <param name="archive" value="Sample.jar" />
  Applet failed to run.  No Java plug-in was found.
</object>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-02
    • 2014-02-19
    • 1970-01-01
    • 1970-01-01
    • 2013-04-06
    • 1970-01-01
    • 1970-01-01
    • 2011-02-25
    相关资源
    最近更新 更多