I had a similar need and I ended up rolling my own. It supports Swing &
JavaFx in the same application, without disturbing OpenGL scaling.
My work is on github but basically I use the standard --fontsize argument
and calculate a scale factor from that.
There are a couple of helper methods that creates scaled Dimensions, Insets
and so on.
https://github.com/trixon/almond/blob/develop/util/src/main/java/se/trixon/almond/util/swing/SwingHelper.java#L208
https://github.com/trixon/almond/blob/develop/util/src/main/java/se/trixon/almond/util/fx/FxHelper.java#L112

If the attached image doesn't make it, there's a copy at
https://mapton.org/images/Screenshot_20231102_203424.png

[image: Screenshot_20231102_203424.png]


Den tors 2 nov. 2023 kl 19:10 skrev Dawid Lokiec <d.lokie...@gmail.com>:

> Hi,
>
> I'm working on a NetBeans Platform application and want to ensure
> accessibility by dynamically scaling up the GUI components for users with
> visual impairments. Is there a way to achieve this programmatically for all
> GUI controls?
>
> Primarily, I'm looking for a way to iterate through all the UI controls in
> the NetBeans Platform and somehow (are there setters for this?!)
> dynamically set the scaling in both the x and y dimensions based on the
> user's previous adjustment through the GUI. I would greatly appreciate it
> if someone could show me how to perform such an iteration and the API for
> setting the scaling.
>
> Thanks in advance.
>
> Dawid.
>

Reply via email to