I want that JTree should display only Directories and JTable should display the folders(child) and files also,
So what is your problem?
a) do you know how to create a JTree?
b) do you know how to create a JTable?
c) do you know how to get a list of directories?
d) do you know how to get a list of directories and tables?
Put the above solutions together and you have your problem solved.
You can start by reading the
Swing tutorial. It has sections on "How to Use Trees" and "How to Use Table". Then you can check out the File API it has a list(...) method for getting the files and directories of a directory.
If you need more help then post your
SSCCE showing the problem.