//程序:paint()方法的调用
//范例文件:CallPaint.javaimport java.awt.*; //一定要制定使用此内集合
import java.applet.*;
public class CallPaint extends Applet
{
public void init()
{
System.out.printIn("init()method...");
}
public void start()
{
System.out.printIn("start()method...");
}
public void paint(Graphics g)
{
//paint()方法在此
//在坐标(10,50)绘制字符串
g.drawString("xye,I love you!",10,50);
//在主控台显示方法执行时机
System.out.printIn("paint()method");
}
public void stop()
{
System.out.printIn("stop()method...");
}
public void destroy()
{
System.out.printIn("destroy()method...");
}
}
<!--net:CallPaint.html-->
<html>
<head><title>paint()method time</title></head>
<body>
<Applet code="CallPaint.class" width=200 height=200><Applet>
</body>
</html>
运行之后出现一下错误
D:\学习\Java\chxu\CallPaint.java:37: 'class' or 'interface' expected
<!--net:CallPaint.html-->
为什么呢!还有我的j2se似乎不支持中文,因为程序中出现中文便会出现illegle character!
//范例文件:CallPaint.javaimport java.awt.*; //一定要制定使用此内集合
import java.applet.*;
public class CallPaint extends Applet
{
public void init()
{
System.out.printIn("init()method...");
}
public void start()
{
System.out.printIn("start()method...");
}
public void paint(Graphics g)
{
//paint()方法在此
//在坐标(10,50)绘制字符串
g.drawString("xye,I love you!",10,50);
//在主控台显示方法执行时机
System.out.printIn("paint()method");
}
public void stop()
{
System.out.printIn("stop()method...");
}
public void destroy()
{
System.out.printIn("destroy()method...");
}
}
<!--net:CallPaint.html-->
<html>
<head><title>paint()method time</title></head>
<body>
<Applet code="CallPaint.class" width=200 height=200><Applet>
</body>
</html>
运行之后出现一下错误
D:\学习\Java\chxu\CallPaint.java:37: 'class' or 'interface' expected
<!--net:CallPaint.html-->
为什么呢!还有我的j2se似乎不支持中文,因为程序中出现中文便会出现illegle character!
解决方案 »
- 想做一个学生管理系统,把信息放入一个文件中,实现增删改查,不会修改和删除
- 请大家看看这个java程序,为什么输出结果不对呢
- 求助 写一个java 表达式编译器
- 帮我编写一个含public String readLine()的程序
- 一个jsp问题
- jsp按比列显示图片,急急急急急急!!!!!!!!!!!1
- 一个关于Applet的问题,请高手赐教!!
- 谁能提供使用PreparedStatement来得到查询结果ResultSet的通用方法?(赠分200)
- 怎么样实现,选择文本后,触发事件,使“复制”菜单变为enable?
- 那位大哥能告诉我jbuilder5的激活密码呀,不胜感激!
- java大问题啊
- 完了,帮帮忙啊,无法运行啊!!!
System.out.printIn("paint()method");