javaanonymous-objects

How do I access the super class of TreeSelectionListener in Java?


this.addTreeSelectionListener(new TreeSelectionListener() {

        public void valueChanged(TreeSelectionEvent e) {

            // How do I access the parent tree from here?           
        }           
    });

Solution

  • TreeSelectionListener is an interface, so the only parent class would be Object, which you should be able to call with super.

    If you meant calling some method of the enclosing class, you can call it directly as within a method.