我正在写一个小JFrame,但它不会找到WindowAdapter,虽然我正在导入它。
import java.awt.event.*; //WindowAdapter should be within this...
import javax.swing.*;
public class Test extends JFrame{
public Test(){
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdatper() {
public void windowClosing(WindowEvent e) {
System.out.println("EXIT!!!!");
}
});
}
public static void main(String args[]){
new Test();
}
}
答案 0 :(得分:1)
您将WindowAdapter()
拼写为WindowAdatper()