Precisely, and exactly why the programming world is an absolute, cargo-culting mess of Javascript frameworks and libraries these days. Sure, React is winning the mindshare war now, but it's just the least ugly baby winning the beauty pageant at the county fair.
If Javascript produces much better UX than Swing/JavaFX then surely that's the right tool for the job? SPA with Angular or React isn't the only choice anymore as Hotwire/Stimulus and similar libraries (Unpoly, Inertia, htmx) testify, allowing you to handle your routing and state management on the server while preserving partial updates on the client.