错误如下 :
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);
}
}
这里有一个CloseFrameDialog http://www.javazx.cn/java1.asp?id=21
刚发现书前面自己定义了CloseFrameDialog类,晕了