You can call Component.setNameon it either a JComponent.putClientPropertysubclass or use the object JLabelas a key - that is Map.
But probably the way is to keep a reference to the source object so that you can write clean, direct code that should not look up the component.
source
share