简体   繁体   English

Java Applet将不会显示在HTML文件中

[英]Java applet will not display in html file

I am about ready to throw my computer through a wall. 我准备将计算机扔到墙上。 I have both the files saved to my desktop. 我将两个文件都保存到了桌面上。 Any help with why this code will not display the java applet would be amazing. 为什么此代码不显示Java小程序的任何帮助都将是惊人的。 Thank You 谢谢

Html Code HTML代码

<html>
<body>
<applet code= "Test.class" width="400" height="400">
</applet>
</body>
</html>

Java Code Java代码

import java.awt.Graphics;

import javax.swing.JApplet;


public class Test extends JApplet{


    private static final long serialVersionUID = 3958434285673728601L;

 public void paint(Graphics g){
    super.paint(g);
     g.drawString("Hello World", 25, 25);
 }

public static long getSerialversionuid1() {
     return serialVersionUID;
 }


 }

Applets are a dead technology. 小程序是一种死技术。 You're wasting your time learning them. 您在浪费时间学习它们。 Oracle has deprecated them. Oracle 已弃用它们。

Instead, I would focus your time on learning HTML5 and JavaScript. 相反,我将把时间集中在学习HTML5和JavaScript上。 Perhaps "Head First HTML5 Programming" to start. 也许从“ Head First HTML5编程”开始。

Applet tag is deprecated in html5 and will not support on Google Chrome. 小程序标记在html5中已弃用,并且在Google Chrome浏览器中不支持。 Use <embed> or <object> instead. 使用<embed><object>代替。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM