void () { myTree.removePropertyChangeListener(JTree.TREE_MODEL_PROPERTY, myPropertyChangeListener); TreeModel model = myTree.getModel(); if (model != null) model.removeTreeModelListener(myTreeModelListener); super.dispose(); }