sample code for file explorer using java
Hi everyone,
I am creating an application which includes a tree explorer similar to the windows explorer. I want to add the all the system disk drives to the root (My Computer). I m facing problems..
Can anyone help me out by suggesting how should i proceed or can give me the code for the same. Remember I need to explore all the dirs and files in the system...
Thanx in advance.
Regards,
neha
[431 byte] By [
neha.uda] at [2007-11-26 23:41:30]

THIS IS THE THIRD TIME YOU HAVE POSTED THIS THREAD IN THE SAME PLACE IN ONE DAY.GIVE... IT... A... REST...
Problems you face
1. How to get the operating system to give up the names of all mounting points that it knows about. This will not be the same from operating system to operating system.
2. How to read a file system from mounting point to terminus (This is easy but if you try to do the whole thing at once it's going to be time consuming and suck up a lot of memory).
3. How to put that into a viewable form that people can understand (A tree view is the obvious choice but that has hurdles of its own for you to get over.
Now all of that said, if what you're really after is to be able to in a platform agnostic manner brows the file system to say for example to load a file and provide a handy graphic means for your user to do that. You're actually talking about half a dozen lines of very simple code.
PS.
but... we have not get better solution,after posting three times,if u know plz reply me.
This will give you drive names
File c[]=new File("").listRoots();
for (int i = 0; i < c.length; i++)
System.out.println("\t" + c[i]);
Abubakar Gurnah
thanks for ur reply.we listed current drives in our program but we also want to list content like files & folder for particular drive.so plz give me samplecode for this.plz send immediately.thanks in advance.neha
> thanks for ur reply.
> we listed current drives in our program but we also
> want to list content like files & folder for
> particular drive.so plz give me samplecode for this.
> plz send immediately.
> thanks in advance.
> neha
neha if you ask question on this forum dont use this terms, they take it like rude!
browse through the File directories, read about them.. and particulary search the forum. There more answers then I can give. If you couldnt find anything let me know! I will try helping you
i dont know about that,so thanx for advising
now i want to add drag & drop properties in explorer that i made by jtree.so plz suggest how i can add these properties.\fromnehaMessage was edited by: neha.ud
check on this tutorial http://www.javaworld.com/javaworld/javatips/jw-javatip97.html
thanx.i think this link will helpful for me.perhaps i wiil solve my problem.very-very thanx for ur quick response.fromneha
nevermind ffsMessage was edited by: SurfManNL
Neha you are welcome! If you have any futher doubt feel free to drop them.Abubakar Gurnah
hi,now i want to know that,i create a table,when i double clicked on objects of table or contents of table,i want to perform some event.so plz give me some example or source code.fromneha
Neha i am going to teach you something that will help you a lot, it is called the ultimate googling
If you want anything just www.goggle.com?q=java+Jtable+Event
it will give you the results.
I am telling you this not because i don't want you to post but rather you will find so many answers and alternative to the solution better. I am using it a lot. If you want be my guest.