I took the following code from a tutorial:
import javax.swing.*;
import java.util.Date;
public class SwingGUI {
public static void main( String[] args
Just guessing, but it matches the problem you describe:
This problem can arise when your own package contains a class that is called JLabel. The local class will then shadow the imported JLabel-class from the javax.swing-package and it might not have the same class-hierarchy as the original class.
To sum it up: it usaually is a bad idea to name ones own classes like existing JDK-classes.