为什么说cannot be resolved to a type?
package cn.game;import javax.swing.JFrame;
public class G1 extends JFrame{
/*初始化窗口*/
public void launchFrame() {
this.setTitle("龙哥出品");
this.setVisible(true);
this.setSize(500, 500);
this.setLocation(300, 300);
this.addWindowListener(new WindowAdapter() { /*为什么这两行说cannot be resolved to a type*/
public void windowClosing(WindowEvent e) {
System.exit(0); }
});
}
public static void main(String args[]) {
G1 a=new G1();
a.launchFrame();
}
} 你把包导齐
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
页:
[1]