public void addSociety() {  workspace.setSelectionPath(new TreePath(root.getPath())); DefaultMutableTreeNode newNode = newSociety();
public void addSociety(SocietyComponent sc) { String name = sc.getSocietyName();  while (societyNames.contains(name)) { name = societyNames.generateName(name); name = (String)JOptionPane.showInputDialog(this, "Enter Society Name", "Society Name Not Unique", JOptionPane.QUESTION_MESSAGE, null, null, name); if (name == null) return; } sc.setName(name);  DefaultMutableTreeNode parentNode = null; DefaultMutableTreeNode node = getSelectedNode(); if (node != null) parentNode = (DefaultMutableTreeNode)node.getParent(); DefaultMutableTreeNode newNode = addSocietyToWorkspace(sc, (DefaultMutableTreeNode)parentNode);
  public void addSociety() {    // make root be the selected node    workspace.setSelectionPath(new TreePath(root.getPath()));     DefaultMutableTreeNode newNode = newSociety();  }