void (@Nullable Component owner, @Nullable Component mouseTarget) { if (myOwner != null) { myOwner.removeHierarchyListener(myHierarchyListener); } if (myMouseTarget != null) { myClickListener.uninstall(myMouseTarget); myMouseTarget.removeMouseMotionListener(myMouseMotionListener); } myOwner = owner; myMouseTarget = mouseTarget; if (myMouseTarget != null) { myClickListener.installOn(myMouseTarget); myMouseTarget.addMouseMotionListener(myMouseMotionListener); } if (myOwner != null) { myOwner.addHierarchyListener(myHierarchyListener); } }