Some years ago I wrote a desktop app in JavaFX. This is a Java UI toolkit (though I wrote in Kotlin), but, you can style it with CSS. It was a piece of cake to give it a GitHub-ish feel. The result felt a lot like a web app, just without the browser chrome. The app in question was a peer to peer app that benefited from some libraries written in Java, so it was a good fit for what the app needed to do.
At the moment it's a bit painful to do this sort of thing because of a lack of good distribution tools. But, that's about to change ...
Most of the Java-for-the-user only exists on Android and niche markets (like some financial software).
And while it's true that the language doesn't determine the UX, the different things I mentioned (frameworks, languages etc.) are mostly relevant due to the mindshare, adoption and general availability of up-to-date resources to get the job done.
It used to be much more acceptable to have "any" UI, but today, if you can't make a generic bootstrap, tailwind or react based UI, you might as well stop and hand that task over to someone else.
Dojo (the JavaScript framework) and ExtJs essentially died the same death (yes, there are still UIs based on those, and the instantly feel like 2006) because of the same reasons, while being completely web-targeted; they tried to make a Swing/AWT/WinForms type of application design a "thing" for the web, which didn't really work out long-term. It was great while it lasted.