JTable au lieu de JTaxtArea

Fermé
mouna310 Messages postés 37 Date d'inscription vendredi 23 janvier 2015 Statut Membre Dernière intervention 3 mai 2015 - 3 mai 2015 à 15:11
salut j'ai ce code qui affiche le contenu d'un neoud (attribut,valeur) dans un textarea mais je veux l'afficher dans un tableau :
 public void valueChanged( TreeSelectionEvent event )
 {  

		if( event.getSource() == jtree ){

 	{
        FramePrincipale.getExplorePanelll().setText(null);

 		TreePath path = jtree.getSelectionPath();
 		String a = changeString(path);
 		Hashtable env1 = System.getProperties();
  		env1.put(Context.INITIAL_CONTEXT_FACTORY,
  		"com.sun.jndi.ldap.LdapCtxFactory");
  		env1.put(Context.PROVIDER_URL, "ldap://localhost:11389/");

  		// Récupére les attributs
  		try {
  			DirContext ctx = new InitialDirContext(env1);
  			Attributes answer = ctx.getAttributes(a);

  			for (NamingEnumeration ae = answer.getAll(); ae.hasMore();) {
  				Attribute attr = (Attribute) ae.next();
				FramePrincipale.getExplorePanelll().append("attribute: " + attr.getID() + " \n" );;

  				// Affiche chaque attribut
  				for (NamingEnumeration e = attr.getAll(); e.hasMore();) {
  					FramePrincipale.getExplorePanelll().append("Valeur: " + e.next() + " \n " );;


  				}
  				// Retour à la ligne
  				System.out.println("");

  			}}catch (NamingException e) {
  		  		}
		   ajouter();
           dn();
          rechecher();
          }
  		 	
  		
 } 
 	
 }