Compiler error, has to do with WindowAdapter and event class. I can't figure it out, please help!
import java.awt.*;
import java.awt.event;
class MyButton extends WindowAdapter {
MyButton() {
Frame f = new Frame("Top Teams in the NFL");
WindowAdapter w = new WindowAdapter();
f.addWindowListener(w);
f.setLayout(new FlowLayout());
f.setSize(500,300);
f.setBackground(Color.darkGray);
Button a = new Button("Raiders");
Button b = new Button("Ravens");
Button c = new Button("Rams");
Button d = new Button("Steelers");
Button e = new Button("Niners");
Button g = new Button("Bears");
f.add(a);
f.add(b);
f.add(c);
f.add(d);
f.add(e);
f.add(g);
f.setVisible(true);
}
public void windowClosing(WindowEvent e) {
window.setVisible(false);
displayMessage("Window closing", e);
}
public static void main(
String args[]) {
MyButton mf = new MyButton();
}
}