I am just starting to mess around with Java's GUI classes specifically with event handling and ask myself a question when I saw that a class that I was implementing didn't recognize its super abstract class.
In short, Why is it necessary to code the below, for the private class WindowEventHandler to implement the abstract class ActionListener?
import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Window extends JFrame { // Vars here public Window() throws HeadlessException { // Window Constructor } private class WindowEventHandler implements ActionListener { public void actionPerformed(ActionEvent e) { } } }
Why is it not possible to just have the statement :import java.awt.*; and not both import java.awt.*; and import java.awt.event.*;
Are these two classes not from the same package? I realize that it is a inheritance concept that I don't understand. Can anyone help?