Source Code : Thread: JTree and FTP

Thread: JTree and FTP
  JTree and FTP
•   

Hello . I am trying to set a ftp list into jtree but jtree appears empty . Here is my code
Java Code:
   import java.io.IOException;
import java.net.SocketException;
import java.util.*;
 
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTree;
 
import org.apache.commons.net.ftp.*;
public class FTPTest
{
  public static void main(String[] args) throws SocketException, IOException
  {
  JFrame fr=new JFrame("Swing Frame");
  fr.setSize(800,600);
  JPanel panel = new JPanel();
  panel.setLayout(null);
  String server = "server_ip";
  String username = "id";
  String password = "pass";
  FTPClient client = new FTPClient();
  client.connect(server);
  client.login(username, password);
  String[] files = client.listNames()   
  Hashtable hash = new Hashtable();   
  for(int i = 0; i < files.length; i++)
  {
  hash.put("Server",files[i]);
  System.out.println(files[i]);
  }   
  JTree tree = new JTree(hash);
  client.disconnect();   
  fr.add(panel);
  panel.add(tree);
  tree.setLocation(350,100);
  tree.setSize(300,400);
  fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);;
  fr.setLocationRelativeTo(null);
  fr.setVisible(true);
  }
}