JFileChooser as a component?

Hey,I need to have directory browsing capability but implementing a one from scratch is too much. Is there anyway to integrate JFileChooser into a component? Like to put it into my application in a panel rather than have it as a dialog?
[250 byte] By [forumusera] at [2007-11-27 3:38:34]
# 1
Have you even read the API? JFileChooser "IS A" JComponent.
camickra at 2007-7-12 8:41:53 > top of Java-index,Desktop,Core GUI APIs...
# 2
You can find an example here: http://java.sun.com/docs/books/tutorial/uiswing/dnd/intro.html#importFiles
Rodney_McKaya at 2007-7-12 8:41:53 > top of Java-index,Desktop,Core GUI APIs...
# 3
OMG, you owned me!Thank you both. 5 dukes for you both!
forumusera at 2007-7-12 8:41:53 > top of Java-index,Desktop,Core GUI APIs...
# 4

Hey

Do you know how I could add keylistener and mouse listener to it?

I want to make it so that when the user presses del on keyboard then the selected file is deleted. And I want to add some right click actions as well.

Just adding listeners to JFileChooser doesn't seem to do the trick.

I would guess that if I take individual components of it and add the listeners to them, then that would work.

Any ideas?

forumusera at 2007-7-12 8:41:53 > top of Java-index,Desktop,Core GUI APIs...