java swing component cannot be resolved

Updating the execution environment under system library to JavaSE-1.7 or JavaSE-1.8 in eclipse should solve the problem.
To update the step below can be followed:

> Right-click on the project
> Select properties
> Java build path
> Library > Add Library > Add JRE SYSTEM Library
> Execution Environment
> Select JavaSE-1.7 or JavaSE-1.8
> Finish

Leave a Comment