错误如下 :
D:\Program Files\JCreatorV4\MyProjects\ActionEvent1\WindowEvent2.java:20: 找不到符号
符号: 类 CloseFrameDialog
位置: 类 WindowEvent2
CloseFrameDialog d = new CloseFrameDialog (this,"关闭","确实要关闭吗?");
^请问这是怎么回事?是JDK的版本不对吗?代码如下:import java.awt.*;
import java.awt.event.*;
public class WindowEvent2 extends Frame implements WindowListener{ public WindowEvent2() {
setTitle("窗口关闭事件的处理");
addWindowListener(this);
}
public void windowClosing(WindowEvent e){
CloseFrameDialog d = new CloseFrameDialog (this,"关闭","确实要关闭吗?");
d.setSize(200,100);
d.setVisible(true);
}
public void windowClosed(WindowEvent e){}
public void windowDeactivated(WindowEvent e){}
public void windowActivated(WindowEvent e){}
public void windowIconified(WindowEvent e){}
public void windowDeiconified(WindowEvent e){}
public void windowOpened(WindowEvent e){}public static void main (String[] args) {
WindowEvent2 me = new WindowEvent2();
me.setSize(200,100);
me.setVisible(true);
}
}
D:\Program Files\JCreatorV4\MyProjects\ActionEvent1\WindowEvent2.java:20: 找不到符号
符号: 类 CloseFrameDialog
位置: 类 WindowEvent2
CloseFrameDialog d = new CloseFrameDialog (this,"关闭","确实要关闭吗?");
^请问这是怎么回事?是JDK的版本不对吗?代码如下:import java.awt.*;
import java.awt.event.*;
public class WindowEvent2 extends Frame implements WindowListener{ public WindowEvent2() {
setTitle("窗口关闭事件的处理");
addWindowListener(this);
}
public void windowClosing(WindowEvent e){
CloseFrameDialog d = new CloseFrameDialog (this,"关闭","确实要关闭吗?");
d.setSize(200,100);
d.setVisible(true);
}
public void windowClosed(WindowEvent e){}
public void windowDeactivated(WindowEvent e){}
public void windowActivated(WindowEvent e){}
public void windowIconified(WindowEvent e){}
public void windowDeiconified(WindowEvent e){}
public void windowOpened(WindowEvent e){}public static void main (String[] args) {
WindowEvent2 me = new WindowEvent2();
me.setSize(200,100);
me.setVisible(true);
}
}
解决方案 »
- 羞愧请教
- 关于Thread.dumpStack(),如何打印出JVM中所有活动线程的堆栈情况啊,类似于websphere的dump和javacore文件啊
- Result的getObject方法奇怪报错
- 想用JAVA做游戏,需要什么平台?是PC游戏,不是J2ME,需要什么样的平台?
- 请问jar文件如何正常运行?(在线等)
- struct中国际化配置文件中,中方乱码怎么处理
- 一个简单的问题
- 环境变量问题~但不是简单的环境变量的问题!希望大家讨论一下
- 【Java------能解决这个问题吗???】
- HashMap是不是有序的,LinkedHashMap是不是有序的
- applet内存设置和修改
- javamail 问题,高手过来帮忙啊。。。。。。。
这里有一个CloseFrameDialog http://www.javazx.cn/java1.asp?id=21
刚发现书前面自己定义了CloseFrameDialog类,晕了