Are you wanting to do this in an application you're creating?
If so, see this tutorial about using File Choosers (which can list directories, also.)
http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html
If not, you need to give a better explanation of what you're trying to do as your statement doesn't make any sense..