我再次需要你的帮助。我最近开始使用 Java 进行编程,并且正在尝试创建我的第一个小程序。我只是使用最基本的代码:
package firstofthings;
import java.awt.*;
import java.applet.*;
public class FirstApplet extends Applet {
public void paint(Graphics g) {
g.drawString("This is my first Java applet!", 20, 30);
}
}
(大括号放在正确的位置,由于某种原因不会出现在正确的位置)
我对html相当精通,我认为是这个容器中的代码是错误的,所以如果你能指出我正确的方向,那就太酷了。
<!DOCTYPE html>
<html>
<head>
<title>FirstApplet</title>
</head>
<body>
<applet
codebase="."
code="FirstApplet.class"
name="FirstApplet"
width="640"
height="480"
hspace="0"
vspace="0"
align="middle"
>
</applet>
<body>
<html>
我拿走了标签,否则它不会显示,所以这里是我得到的错误的详细信息
ClassNotFoundExeption
Java Plug-in 10.5.1.255
Using JRE version 1.7.0_11-b21 Java HotSpot(TM) Client VM
User home directory = C:\Users\Owner
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------