What is the difference between:
java.awt.*;
and:
java.awt.event.*;
I find both in many programs.
Packages in Java are not nested.
When you import java.awt.*, you are only importing all the classes and interfaces that are in the package java.awt - you are not importing all the packages that are under java.awt, such as java.awt.event.
Even though it looks like packages are nested (i.e., it looks like as if java.awt.event is a "subpackage" of java.awt), this is not really the case. You should regard java.awt and java.awt.event as two different, unrelated packages that happen to have a common part in their names.