Eclipse sometimes has problems importing stuff from the javax.swing class. For me, it started with trying to use javax.swing.JOptionPane; Took me like an hour to find a solution. Since this worked for me, hopefully it will work for you and save you an hour of searching. I found the solution from here: https://stackoverflow.com/questions/2...
similar queries
javax.swing cannot be resolved
javax.swing is not working
javax.swing importing problem
javax.swing is not importing
javax.swing importing fix
This fix also works for java.awt imports; I figured this out while I got a cannot be resolved error while trying to import java.awt.FlowLayout .Note that awt is short for Abstract Window Toolkit
On this page of the site you can watch the video online javax.swing Cannot Be Resolved Error Fix with a duration of hours minute second in good quality, which was uploaded by the user Raqib Zaman 15 January 2019, share the link with friends and acquaintances, this video has already been watched 63,374 times on youtube and it was liked by 782 viewers. Enjoy your viewing!