When did the popularity of swing music end?

Swing music was most popular during the mid 1930's to the mid 1940's. Starting in 1942, a recording ban by the union that most jazz musicians belonged to caused swing music to be played less frequently on the radio and other types of music took over.