Only if the Swing program uses any classes out of AWT, or any AWT event classes (which it most probably will...
).
When you import java.awt.*, you import all the classes in the java.awt package, but no sub-packages of java.awt (such as java.awt.event). You have to import each package separately. As for
why? I guess that's just how James Gosling wanted to work imports when he made the
Java language specification.
(Actually, though, it's a good thing to specifically import packages and not have them load subpackages. You have no idea how deep the subpackages go... think what would happen if you said "import java.*" in this situation!
)
In your case, if you
only need access to the AWT events in your class, you can just import java.awt.event, you don't have to import java.awt.
[ December 26, 2002: Message edited by: Nathan Pruett ]