STree tree = (STree)SessionManager.getSession().getProperty("tree");  LdapTreeNode parentNode = (LdapTreeNode)tree.getLastSelectedPathComponent(); if (parentNode == null) parentNode = (LdapTreeNode)(((DefaultTreeModel)(tree.getModel())).getRoot()); LdapTreeNode node = new LdapTreeNode(getContext(),parentNode,ownDN); DefaultTreeModel model = (DefaultTreeModel)tree.getModel(); model.insertNodeInto(node,parentNode,0);
    protected void ok() {        try {            String dn = dnTextField.getText();            String objectClass = (String)objectClassList.getSelectedValue();            Attributes attributes = editor.getData();            Attributes specifiedAttributes = new BasicAttributes();            NamingEnumeration enum = attributes.getAll();	    while (enum.hasMore()) {		Attribute attribute = (Attribute)enum.next();                if (attribute.size() != 0)                    specifiedAttributes.put(attribute);            }            specifiedAttributes.put(new BasicAttribute("objectClass", objectClass));	    getContext().createSubcontext(dn, specifiedAttributes);            editor.setData(emptyAttributes);            objectClassLabel.setVisible(false);            editor.setVisible(false);            okButton.setVisible(false);            cancelButton.setVisible(false);            addButton.setVisible(true);            objectClassList.setVisible(true);                                            }