急求:编写一个JAVA APPLET,使之能够在游览器中显示“Welcon to Java Applet Word!”的字符串信息
急求:编写一个JAVAAPPLET,使之能够在游览器中显示“WelcontoJavaAppletWord!”的字符串信息...
急求:编写一个JAVA APPLET,使之能够在游览器中显示“Welcon to Java Applet Word!”的字符串信息
展开
2个回答
展开全部
HelloApplet.java
import java.awt.*;
import java.applet.*;
public class HelloApplet extends Applet implements Runnable {
/**
*
*/
private static final long serialVersionUID = 1L;
public void init() {
resize(300,300);
}
public void paint(Graphics g) {
g.drawString("Welcom to Java Applet Word!", 5, 125);
}
public void run() {
}
}
HelloApplet.html
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<h1>Test</h1>
<hr>
<applet code="HelloApplet.class" width=170 height=150>
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
Your browser is completely ignoring the <APPLET> tag!
</applet>
<hr>
</BODY>
</HTML>
import java.awt.*;
import java.applet.*;
public class HelloApplet extends Applet implements Runnable {
/**
*
*/
private static final long serialVersionUID = 1L;
public void init() {
resize(300,300);
}
public void paint(Graphics g) {
g.drawString("Welcom to Java Applet Word!", 5, 125);
}
public void run() {
}
}
HelloApplet.html
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<h1>Test</h1>
<hr>
<applet code="HelloApplet.class" width=170 height=150>
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
Your browser is completely ignoring the <APPLET> tag!
</applet>
<hr>
</BODY>
</HTML>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询