public void actionPerformed(ActionEvent e) { TreePath path = tree.getSelectionPath(); if(path!=null && ((ISwingTreeNode)path.getLastPathComponent()).hasProperties()) { showProperties(((ISwingTreeNode)path.getLastPathComponent()).getPropertiesComponent()); } } };