applet:
import javax.swing.*;
import java.awt.*;
public class EX9_1 extends JApplet{
public void pain(Graphics g){
super.paint(g);
g.drawString("welcome the the my first apllet!",25,25);
}}html代码:
<html>
<body>
<applet code=EX9_1.class width="200" height=100>
</applet>
</body>
</html>
小程序查看器中没有输出内容
在浏览器中打开也不行.......
import javax.swing.*;
import java.awt.*;
public class EX9_1 extends JApplet{
public void pain(Graphics g){
super.paint(g);
g.drawString("welcome the the my first apllet!",25,25);
}}html代码:
<html>
<body>
<applet code=EX9_1.class width="200" height=100>
</applet>
</body>
</html>
小程序查看器中没有输出内容
在浏览器中打开也不行.......
你的在eclipse中运行,能在小程序窗口中看到显示吗?
public void pain(Graphics g){
super.paint(g);
g.drawString("welcome the the my first apllet!",25,25);
}
如果就是pain,就不会有输出,因为pain没有执行,只有paint才能自动执行(页面刷新时执行)