hi every body, i was working on my Client-server file hosting system and at this level my program can upload file from client to server but it is also expected to download the files previously uploaded. Now i can browse the filenames from the server with the following code,
try {
Socket Dclient = new Socket("localhost", 7777);
System.out.println("Connection is created");
in = new ObjectInputStream(Dclient.getInputStream());
String st [] = new String[80];
while( (st.length)!=-1)
{
fileName=in.readUTF();
String data[] = {fileName};
//System.out.printl(fileName);
jList1=new JList(data);
}
in.close();
Dclient.close();
}catch (Exception e) {
e.printstacktrace();
}
here i have two problems the first is even though all files were sent from the server only one is displayed on the Jlist(Interface problem), and secondly how can i download the content of the file name really need help.
if u need more explanation u can ask me
waiting for reply