how to get all mp3 files in my windows system including (c:,d:,e:,ect) using jtree in java.
im just getting all directories & files in specific directories but i know wish to get all mp3 files in my all system drives
4 Replies - 149 Views - Last Post: 05 January 2013 - 03:12 PM
#1
how to get all mp3 files in my windows system using jtree in java
Posted 04 January 2013 - 09:00 PM
Replies To: how to get all mp3 files in my windows system using jtree in java
#2
Re: how to get all mp3 files in my windows system using jtree in java
Posted 04 January 2013 - 09:42 PM
How about recursively searching from the root of each drive?
#3
Re: how to get all mp3 files in my windows system using jtree in java
Posted 05 January 2013 - 01:34 PM
As blackcompe suggested, retrieve all your root directories:
http://docs.oracle.c...al/io/dirs.html
Then recurse through them filtering filenames. Though I imagine this will probably take a large sum of time.
http://docs.oracle.c...al/io/dirs.html
Then recurse through them filtering filenames. Though I imagine this will probably take a large sum of time.
#4
Re: how to get all mp3 files in my windows system using jtree in java
Posted 05 January 2013 - 02:23 PM
It would take a long time to scan the whole file system upfront. You could make the application appear a lot faster if you only scan a directory when you expand a node in the tree. You could make it seem lightning fast if you preload the contents of all the visible folders in the background.
#5
Re: how to get all mp3 files in my windows system using jtree in java
Posted 05 January 2013 - 03:12 PM
You have to aspect of a problem and you seems to have incorrectly merged them 
A JTree is just a fancy GUI component to display data
Your Data is all the .MP3 files below few root directories
You can have 2 different approachs to this problem:
- scan all the directories for the .MP3 files, save that data in a data structure and then fill your JTree based oon that data structure
- display in the JTree the root directories and then start the search when one of them is clicked dinamically expanding them when required
A JTree is just a fancy GUI component to display data
Your Data is all the .MP3 files below few root directories
You can have 2 different approachs to this problem:
- scan all the directories for the .MP3 files, save that data in a data structure and then fill your JTree based oon that data structure
- display in the JTree the root directories and then start the search when one of them is clicked dinamically expanding them when required
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|