当前位置: 技术问答>java相关
jcreator提示我这样的错误,一个简单的java小程序.........?????
来源: 互联网 发布时间:2015-06-01
本文导语: import java.awt.Graphics; import java.awt.Event; import java.awt.Point; public class MouseEnterAndExit extends java.applet.Applet { String CurrentMessage=""; public boolean mouseEnter(Event evt,int x,int y) { CurrentMessage="救命阿又老鼠..."; repaint(); ...
import java.awt.Graphics;
import java.awt.Event;
import java.awt.Point;
public class MouseEnterAndExit extends java.applet.Applet {
String CurrentMessage="";
public boolean mouseEnter(Event evt,int x,int y) {
CurrentMessage="救命阿又老鼠...";
repaint();
return true;
}
public boolean mouseExit(Event evt,int x,int y) {
CurrentMessage="老鼠走了,真是吓死我了";
repaint();
return true;
}
public void paint(Graphics g) {
g.drawString(CurrentMessage ,5,15);
}
}
错误: Note: C:WINDOWSDesktopjavaMouseEnterAndExit.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
import java.awt.Event;
import java.awt.Point;
public class MouseEnterAndExit extends java.applet.Applet {
String CurrentMessage="";
public boolean mouseEnter(Event evt,int x,int y) {
CurrentMessage="救命阿又老鼠...";
repaint();
return true;
}
public boolean mouseExit(Event evt,int x,int y) {
CurrentMessage="老鼠走了,真是吓死我了";
repaint();
return true;
}
public void paint(Graphics g) {
g.drawString(CurrentMessage ,5,15);
}
}
错误: Note: C:WINDOWSDesktopjavaMouseEnterAndExit.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
|
public boolean mouseEnter(Event evt,int x,int y) {
public boolean mouseExit(Event evt,int x,int y) {
这两个方法过时了。
学些新的东西吧。
public boolean mouseExit(Event evt,int x,int y) {
这两个方法过时了。
学些新的东西吧。
|
那是1。1以前的版本了