https://kotlinlang.org logo
l

LastExceed

01/20/2020, 6:05 PM
is it possible to achieve native look and feel with tornadofx ? if yes, how?
a

altavir

01/20/2020, 6:08 PM
Which one is native? If you mean system-specific look, JavaFX uses it by default.
l

LastExceed

01/20/2020, 6:09 PM
yes i mean system specific.

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

this doesnt look very windows10-like to me
a

altavir

01/20/2020, 6:12 PM
You can CSS for fine-tune. But basically, it is reasonably windows10-like.
JavaFX mostly just uses native widgets.
l

LastExceed

01/20/2020, 6:14 PM
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

altavir

01/20/2020, 6:15 PM
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

LastExceed

01/20/2020, 6:16 PM
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

LastExceed

01/20/2020, 6:19 PM

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

altavir

01/20/2020, 6:22 PM
Default design for javafx is made to look good on all platforms. It actually does. You can also use JPhoenix for material design.
l

LastExceed

01/20/2020, 6:22 PM
again, that is not the point here
a

altavir

01/20/2020, 6:23 PM
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

LastExceed

01/20/2020, 6:24 PM
it looks like JavaFX is made to look the same on all platforms. that is NOT what i want
a

altavir

01/20/2020, 6:25 PM
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

LastExceed

01/20/2020, 6:30 PM
why? is it that unreasonable to strive for an application to adapt to the look and feel of the platform its running on?
a

altavir

01/20/2020, 6:31 PM
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

LastExceed

01/20/2020, 6:38 PM
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

Ruckus

01/20/2020, 7:10 PM
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

LastExceed

01/20/2020, 7:12 PM
alright, looks like i'll be switching to swing then
r

Ruckus

01/20/2020, 7:13 PM
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

LastExceed

01/20/2020, 7:22 PM
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

Ruckus

01/20/2020, 7:26 PM
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

LastExceed

01/20/2020, 7:31 PM
can you elaborate on why the jvm is a bad choice when looking for native look and feel ?
r

Ruckus

01/20/2020, 7:38 PM
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

bjonnh

01/20/2020, 9:26 PM
@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

LastExceed

01/21/2020, 11:20 AM
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

bjonnh

01/21/2020, 6:36 PM
ohh
I didn't know swing was using native widgets
7 Views