I'm trying to understand how to support different resolutions in JavaFX. I'm looking for a sort of a guide about how to achieve this.
I want to create an application which requires a minimum resolution of, for example, 1280×720. And I want that my applications looks fine on any higher resolution too (like 1920×1080). Also, the application should look good at different DPI values. How can I do that?
Lets set as minimum requirements JDK 11.0.2+ and JavaFX 11.0.2+ to be more specific.
What I (seem to) understand now:
- Minimum width and height of the stage have to be set.
- I can not bother about DPI support, as it seems to be implemented.
What I still don't understand:
- How do I set the dimensions of elements, indents, etc.
- Should I set values in pixels for the minimum supported resolution and then multiply them by the coefficient according to the current resolution?
- Or should I build up the size as a percentage of the width/height of the screen?
- Or should I do it all in a very different way?
- Should I avoid any controls/layouts?
I hope I was clear enough.
I'm new to creating interfaces for real, not toy applications. And I will appreciate any help, be it comments, explanations, code samples or links to articles.
Thank you in advance for your help.