JDK-8088856 : Umbrella : issues related to dynamic skin replacement
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2013-10-13
  • Updated: 2022-12-13
  • Resolved: 2022-12-13
Related Reports
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Relates :  
Description
Run the attached appliction, select any control, click button to replace the skin.
Comments
duplicate of JDK-8241364
13-12-2022

This will be addressed in openjfx20, as a part of JDK-8241364
09-12-2022

The basic problem is that when skins are disposed, that they are not removing all children and listeners that were added to the control. This means that the skin is not truly disposed, and we run into visual and runtime glitches when properties change that the old skin observed. There are really two options to explore here: 1) Just fix up the skins so that they dispose properly. 2) Add some API (even if it is internal to start with) that acts as a conduit for all children modifications / listener modifications. This conduit can then record the totality of the changes, and either automatically dispose of these modifications, or throw an exception when dispose is called and not all modifications are cleaned up. My preference is approach two, but it won't be a small undertaking, so I think for now it can be pushed out of JDK 9.
01-05-2016

Reminder for when I look into this: the set method inside the Control skin property has the following code which prevents the new skin from being set: if (v == null ? oldValue == null : oldValue != null && v.getClass().equals(oldValue.getClass())) return;
13-10-2013