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
Watch video javax.swing Cannot Be Resolved Error Fix online without registration, duration hours minute second in high quality. This video was added by user Raqib Zaman 15 January 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 62,863 once and liked it 787 people.