Is it possible to get the name of the panel that a JLabel is added to? I added some JLabels to different JPanels, and I want to call different mouse events according to whic
If you run label.getParent() it will return the panel the label is inside.
label.getParent()
You could then call parent.getName() but the fact the you will now have the object you might not need this now.
parent.getName()