I took the following code from a tutorial:
import javax.swing.*;
import java.util.Date;
public class SwingGUI {
public static void main( String[] args
I faced the same issue and found that my project was using the Java 8 libraries.
I installed the Java 7 library, added the same to the project properties by referencing the library from the installed C:\Program Files\Java
folder and the error was gone.
Looks like, the new Java 8 version may a different way to resolve the swing component.