basically because Oracle is fostering JavaFX. Swing is still (and will be in the future) part of the JRE/JDK, but the recommendations go towards JavaFX.
Technically, JavaFX provides a much more modern approach. If you start learning Java, i would recommend to go towards JavaFX.
Here are some facts published by Oracle that could help you with your decision: