Applet
WelcomeApplet类:
import javax.swing.*; public class WelcomeApplet extends JApplet{ public void init(){ add(new JLabel("WelocomeApplet",JLabel.CENTER)); } }
写相应的Html:
<html> <head> <title>Welcome Java Applet</title> </head> <body> <applet code="WelcomeApplet.class" <--需要把该文档和WelcomeApplet.class放在一块,或者用绝对路径>
with=350 height=200> </applet> </body> </html>
本文介绍了一个简单的Java Applet示例,展示如何创建一个名为WelcomeApplet的应用程序,并将其嵌入到HTML页面中。

被折叠的 条评论
为什么被折叠?



