Closed EchoEllet closed 5 months ago
FlatAnimatedLafChange.showSnapshot()
and FlatAnimatedLafChange.hideSnapshotWithAnimation()
are only needed if you want animated (e.g. fading from light to dark) theme change. It is not required.
See https://www.javadoc.io/doc/com.formdev/flatlaf-extras/latest/com/formdev/flatlaf/extras/FlatAnimatedLafChange.html
What you need is UIManager.setLookAndFeel( ... )
or e.g. FlatDarkLaf.setup()
, which changes the active theme (look and feel), but does not update existing components.
FlatLaf.updateUI();
is required to update existing components with the new theme.
FlatAnimatedLafChange.showSnapshot()
andFlatAnimatedLafChange.hideSnapshotWithAnimation()
are only needed if you want animated (e.g. fading from light to dark) theme change. It is not required. See https://www.javadoc.io/doc/com.formdev/flatlaf-extras/latest/com/formdev/flatlaf/extras/FlatAnimatedLafChange.htmlWhat you need is
UIManager.setLookAndFeel( ... )
or e.g.FlatDarkLaf.setup()
, which changes the active theme (look and feel), but does not update existing components.
FlatLaf.updateUI();
is required to update existing components with the new theme.
So it's okay to change the theme by calling FlatDarkLaf.setup()
and FlatLaf.updateUI
in runtime after setting an initial theme
Thank you once again.
Hi, I would like to know more details on how to switch between themes in the recommended way, I already looked at the example (at this setTheme() method) and I'm still not sure on how to achieve that correctly, for example, when do we need to call the following functions:
or:
The class
FlatAnimatedLafChange
is from FlatLaf extrasRelated issues:
135
204
Consider enabling GitHub Discussions for this repository as it's designed for questions and suggestions.
I appreciate your time and effort on this library.