Closed ingokegel closed 2 years ago
Many thanks for reporting.
I've added this property change listeners to FlatLaf v2 for styling support. Unfortunately, the implementation is wrong for shared UIs.
A new instance of the listener is created for each component, but stored in a shared UI instance and overwrites previous listener... So the there is always a reference to the last created component in the last listener... Previously created components should be not referenced because their listeners are not referenced.
Working on a fix...
Should be fixed in latest 2.0.1-SNAPSHOT
https://github.com/JFormDesigner/FlatLaf#snapshots
Please give it a try
Thank you, now it looks good in my tests!
The cached property change listeners in shared UIs strongly reference an instance for which listeners were installed.
Should this listener maybe be stored in a client property of the component instead of in a field in the shared UI so that the component can be garbage collected?