I am developing a GUI Java-based application using swing and am thinking of using the MIT license, though when reading the licenses stated in the components of java swing I see that they are licensed under the GNU General Public Licensed version 2. From what I understand from reading about these licenses is that I cannot use a permissive license like MIT if I'm using code under the GNU license.
A similar question has been asked here: https://stackoverflow.com/questions/3111455/releasing-code-containing-java-swing-what-license The answer that they received is that it is possible to use any license that they want provided they only use swing library and not actually use or modify the source code.
From what I understood, GNU license is a copyleft license meaning that usage of the code forces the developer to use the same license.
Why then is it possible to use the MIT license when using the swing library?