If I say:
import java.awt.event.ActionListener;
I get the ActionListener Class. If I say:
import java.awt.event.*;
<
From the Java Tutorials: Apparent Hierarchies of Packages
At first, packages appear to be hierarchical, but they are not. For example, the Java API includes a
java.awtpackage, ajava.awt.colorpackage, ajava.awt.fontpackage, and many others that begin with java.awt. However, thejava.awt.colorpackage, thejava.awt.fontpackage, and otherjava.awt.xxxxpackages are not included in thejava.awtpackage. The prefixjava.awt(the Java Abstract Window Toolkit) is used for a number of related packages to make the relationship evident, but not to show inclusion.Importing
java.awt.*imports all of the types in thejava.awtpackage, but it does not importjava.awt.color,java.awt.font, or any otherjava.awt.xxxxpackages. If you plan to use the classes and other types injava.awt.coloras well as those in java.awt, you must import both packages with all their files:
import java.awt.*;
import java.awt.color.*;