is it possible to achieve native look and feel wit...
# tornadofx
l
is it possible to achieve native look and feel with tornadofx ? if yes, how?
a
Which one is native? If you mean system-specific look, JavaFX uses it by default.
l
yes i mean system specific.

https://i.imgur.com/pTzSD52.png

this doesnt look very windows10-like to me
a
You can CSS for fine-tune. But basically, it is reasonably windows10-like.
JavaFX mostly just uses native widgets.
l
it is reasonably windows10-like
this completely dodges my question
You can CSS for fine-tune
that would mean re-creating platform specific designs, that sounds like a very bad idea
a
I do not know, what do you mean about platform-specific design. I've opened few windows system windows, and they use different design. Old style looks like your screenshot.
l
let me quickly recreate that window for comparison
a
Here is the theme. which resemles modern windows control elements: https://pixelduke.com/java-javafx-theme-jmetro/
l

https://i.imgur.com/fFWU1HC.png

this is what i wanted
the thing is, i don't wanna set a specific theme because win10 theme on linux or mac would look pretty out of place
i was wondering if there was an option to adopt whatever the default design of the current os
but looks like i'll have to switch to swing for that
a
Default design for javafx is made to look good on all platforms. It actually does. You can also use JPhoenix for material design.
l
again, that is not the point here
a
Here is the modena showcase in old fxperience post: http://fxexperience.com/2013/01/modena-new-theme-for-javafx-8/ (modena is the default now)
l
it looks like JavaFX is made to look the same on all platforms. that is NOT what i want
a
It is not the same. Menus are different and there are some additional differences, but is cross-platform. If you have different look for different platform, you can say bye-bye to cross-platform UI development
l
why? is it that unreasonable to strive for an application to adapt to the look and feel of the platform its running on?
a
Because you need to have separate design for each platform. If buttons look different on different OS, they have different sizes. Therefore, you need adjust the whole scene graph and possibly do different composition.
l
just because they have different design doesnt necessarily mean they have different size. the default might be different, but so far i havent seen a button that isnt sizable
r
Is it that unreasonable to strive for an application to adapt to the look and feel of the platform its running on?
In this case, yes. Other Java GUI toolkits have strived for a native look in each platform, but JavaFx was specifically designed not to. If you want a native feel for a specific platform, you can easily do that with the appropriate style sheet / user agent style sheet.
l
alright, looks like i'll be switching to swing then
r
The idea is that if you are releasing on multiple platform, it will be consistent across platforms. That also came with a number of other benefits, such as as not being limited to a common subset of controls available on all platform.
I'd think about that pretty hard before making that switch. Spring is deprecated, and thanks to the proliferation of web apps, most users don't really care if it's "native looking". Many native apps are also heavily themed specifically to avoid the native look or because they believe consistency across platforms is more important.
Granted, if a native look is really that important, the JVM is probably the wrong choice to start with. You may want to look into platform specific toolkits provided by the platform maintainers.
But of course, take what I say with a grain of salt. My opinions aren't gospel 🙂
l
to me this is a matter of personal taste. i dont aim to make a public software with many users so i dont care about popular opinion. but i must admit that
Spring is deprecated
this argument basically kills it
r
Ah, sorry. I just jumped to the conclusion this was for a large user base. Personal taste for personal tools is a whole different game.
l
can you elaborate on why the jvm is a bad choice when looking for native look and feel ?
r
Not just of you want a native look and feel, but if it's a priority. Especially for the feel part. General purpose toolkits tend to target general purpose usage, and you often lose a lot of the nuance that makes an app feel integrated and native. That's not as big of a concern with Windows because not even Microsoft is consistent with themselves, let alone all the third party stuff that's is Windows specific, but still doing their own thing.
That being said, most (if not all) platform vendors offer their own toolkits / SDKs to get that native feel easily. Granted that's usually done with the express purpose of tying you to their platform, but if you only care about that platform, it may be worth it.
b
@LastExceed why not just detecting platform at runtime and selecting the according stylesheet?
you reasonably only have three to handle. Linux people tend to care less about look and feel (and if they do, let them load their own css maybe?)
Not sure what "spring is deprecated" means here.
l
why not just detecting platform at runtime and selecting the according stylesheet?
because the stylesheets are just recreations of the native design (ideally you wouldn't be able to tell the difference, but this was rather a conceptual question).
Not sure what "spring is deprecated" means here.
*swing (typo)
b
ohh
I didn't know swing was using native widgets