Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/07/2005, 10:34
jasegu
 
Fecha de Ingreso: julio-2005
Mensajes: 6
Antigüedad: 19 años, 6 meses
Puntos: 0
Pregunta Ingresar nodos al jtree


BUENAS COMPAÑEROS DEL MUNDO DE JAVA, NECESITO AYUDA DE COMO IMPLEMENTAR O INGRESAR LOS NODOS A UN JTREE YA QUE ME INGRESA LA RAIZ Y EL NODO PERO NO ME INGRESA MAS EL CODIGO QUE TENGO ES EL SIGUIENTE:


Código PHP:
public void createNodes(NodoArbol x) {
               
        
DefaultMutableTreeNode category = new DefaultMutableTreeNode("(Raiz es ) "+arbol.raiz.nombre+" "+arbol.raiz.dato);
        
DefaultTreeModel treeModel = new DefaultTreeModel(category); 
        
        
//for(i = 0; i < 3;i++)
        
treeModel.insertNodeInto(new DefaultMutableTreeNode(x.dato+" "+x.nombre),category,0);
             
             
        
       
jTree1.setModel(treeModel);
      
    }
//Fin del metodo 
NO SE SI ALGUIEN ME PUEDE AYUDAR YA QUE LO INTENTADO TODO Y NO SE POR DONDE DARLE.