One feature of theming that we have not talked about so far is that it is possible to change themes at runtime by using the
setThemeProps method of
UIManager. But when a theme is set on the fly there will be, in general, components that are not visible, and the effect of setting a theme on these components is not predictable. In order to make sure that even the components that are not visible have their styles properly updated, you should call the
refreshTheme method using code like this:
When a theme is installed at runtime, there may be form instances that have been created earlier and are to be displayed later. In order that the newly installed theme may take effect on these ...