private void jTree1ValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_jTree1ValueChanged
        // TODO add your handling code here:
        int i, j;
        
        labels.add(jLabel1); labels.add(jLabel2); labels.add(jLabel3); 
        labels.add(jLabel4); labels.add(jLabel5);
        texts.add(jTextField1); texts.add(jTextField2); texts.add(jTextField3);
        texts.add(jTextField4); texts.add(jTextField5);
                
        jComboBox1.setVisible(false);
        jLabel6.setVisible(false);
        for(i=0; i<labels.size(); i++){
            labels.get(i).setVisible(false);
            texts.get(i).setVisible(false);
        }
        
        TreePath[] paths = evt.getPaths();
        DefaultMutableTreeNode node = new DefaultMutableTreeNode();
 
	// Iterate through all affected nodes
	for (i=0; i<paths.length; i++) {
		if (evt.isAddedPath(i)) {
			// This node has been selected
			node = (DefaultMutableTreeNode) paths[i].getLastPathComponent();
                        System.out.println(node.getUserObject().getClass());
			break;
		} else {
			// This node has been deselected
			break;
		}
	}
        //System.out.println(generated.Test4.attributes(node));
        atribute = generated.Test4.attributes(node);
        System.out.println(atribute);

        if(!atribute.isEmpty())
            jButton10.setVisible(true);
        else
            jButton10.setVisible(false);
        
        // Insert node
        jComboBox2.removeAllItems();
        List<String> insChild;
        insChild = generated.Test4.getChilds(node);
        
        if(!insChild.isEmpty() /*&& !generated.Test4.getName(node).equals("hierarchy")*/){
            jComboBox2.setVisible(true);
            jButton1.setVisible(true);
            for(i=0; i<insChild.size(); i++)
                jComboBox2.addItem(insChild.get(i));
        }
        else{
            jComboBox2.setVisible(false);
            jButton1.setVisible(false);
        }
        
        for(i=0; i<atribute.size()/2; i++){
            if(atribute.get(2*i).equals("type") ||
                    atribute.get(2*i).equals("direction")){
                
                jLabel6.setText(atribute.get(2*i));
                jLabel6.setVisible(true);
                jComboBox1.setVisible(true);
                jComboBox1.removeAllItems();
                
                if(atribute.get(2*i).equals("type")){
                    jComboBox1.addItem("article");
                    jComboBox1.addItem("body");
                    jComboBox1.addItem("page_number");
                    jComboBox1.addItem("paragraph");
                    jComboBox1.addItem("title");
                    jComboBox1.addItem("subtitle");
                }
                if(atribute.get(2*i).equals("direction")){
                    jComboBox1.addItem("ascending");
                    jComboBox1.addItem("descending");
                }
                for(j=0; j<jComboBox1.getItemCount(); j++){
                    if(jComboBox1.getItemAt(j).toString().equals(atribute.get(2*i+1))){
                        jComboBox1.setSelectedIndex(j);
                    }
                }
            }
            else{
                labels.get(i).setText(atribute.get(2*i));
                texts.get(i).setText(atribute.get(2*i+1));
                labels.get(i).setVisible(true);
                texts.get(i).setVisible(true);
            }
        }
        currentNode = node;
    }//GEN-LAST:event_jTree1ValueChanged