Foros del Web » Programación para mayores de 30 ;) » Java »

Ingresar nodos al jtree

Estas en el tema de Ingresar nodos al jtree en el foro de Java en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 28/07/2005, 10:34
 
Fecha de Ingreso: julio-2005
Mensajes: 6
Antigüedad: 18 años, 9 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.
  #2 (permalink)  
Antiguo 30/07/2005, 16:29
Avatar de Modern_Crusades  
Fecha de Ingreso: junio-2005
Mensajes: 620
Antigüedad: 18 años, 10 meses
Puntos: 1
http://www.gfc.edu.co/estudiantes/an...arbol/x29.html
tal vez este turorial te ayude
  #3 (permalink)  
Antiguo 01/08/2005, 11:05
 
Fecha de Ingreso: julio-2005
Mensajes: 6
Antigüedad: 18 años, 9 meses
Puntos: 0
Gracias

Cita:
Iniciado por Modern_Crusades

Ya resolvi el problema de ingresar nodos pero ahora quiesiera que si yo elijo un nodo ingrese otro nodo en ese si tienes alguna idea porfarvor ayuadame.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:27.