Reputation: 1312
I have a class
which implements
MouseListner
.
If i set this class
instance to null
will it remove MouseListener
from the JPanel? or Do i have to manually remove MouseListening
from JPanel
using removeMouseListener
Upvotes: 0
Views: 32
Reputation: 1639
You have only set your reference to the MouseListener
to null. That means that you can't access the MouseListener
through that variable, but the MouseListener
itself still exists, so you must remove it from the JPanel
using removeMouseListener
.
Upvotes: 1