I built an application that has two sides. client and server and when I run it using localhost it's fine. but the problem is the codes to help my JTree to remote directories located on server while I use two computers as client and server. I used FileSystemModel.java class
That code should load the local file system, given a File (line 7) that specifies a file system root.
I'm not sure that FileSystemModel will help you a lot here, other than as a template for you to create your own remote FTP version. If you look through the code of FileSystemModel you will see that there aren't many places where it queries the underlying file system, so all you need to do is to replace those with corresponding FTP queries.
this class (FileSystemModel), I took it from internet because it was my first time to use JTree. so don't think that am good in Java. the problem I have is where I can put those FTP queries. am so sorry to ask you many questions.
In that case, rather than rely on someone else's code that you don't understand, you will benefit more by doing it yourself.
Start by studying Oracle's excellent JTree tutorial, especially the section on creating a data model.
Then think about how the files and directories of your file system will correspond to the different elements and methods in the tree data model. Finally, think about how to get that info in a convenient form via FTP.
Just take it one small step at a time.
now I get some logic on how I can create tree data model. so the problem I have is this, I have only 2 days to finish this project. that's why am not able to read carefully all these theories. so can't you give me codes that I can refer from, if you have them. it will be helpful to me.
2 days is your problem, nobody else's. You are clearly expected to do your own homework, so don't expect anyone to do it for you.
As I said before, if you hit a specific problem, feel free to come back here for specific help.