SocietyComponent society = (SocietyComponent)node.getUserObject(); if (!society.isEditable()) { int result = JOptionPane.showConfirmDialog(this, "Society is in use; delete anyway?", "Society Not Editable", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (result != JOptionPane.YES_OPTION) return; } model.removeNodeFromParent(node); societyNames.remove(society.getSocietyName());
SocietyComponent society = (SocietyComponent)node.getUserObject(); if (!society.isEditable()) { int result = JOptionPane.showConfirmDialog(this, "Society is in use; delete anyway?", "Society Not Editable", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (result != JOptionPane.YES_OPTION) return;
    private void deleteSociety(DefaultMutableTreeNode node) {      SocietyComponent society = (SocietyComponent)node.getUserObject();      if (!society.isEditable()) {	int result = JOptionPane.showConfirmDialog(this,				      "Society is in use; delete anyway?",				      "Society Not Editable",				      JOptionPane.YES_NO_OPTION,				      JOptionPane.WARNING_MESSAGE);	if (result != JOptionPane.YES_OPTION)	  return;      }      model.removeNodeFromParent(node);      societyNames.remove(society.getSocietyName());    }