If that's your goal, you should look at CheerpJ, which supports Swing and has the goal of making it so you can easily port applets and other existing apps to the web.
I think TeaVM is more focused on letting you share code with the web instead of porting entire apps.
I think TeaVM is more focused on letting you share code with the web instead of porting entire apps.