This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes alternative to JFileChooser (panel similar to Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "alternative to JFileChooser (panel similar to "drop the file here")" Watch "alternative to JFileChooser (panel similar to "drop the file here")" New topic
Author

alternative to JFileChooser (panel similar to "drop the file here")

juan perez
Greenhorn

Joined: Feb 05, 2013
Posts: 4
I would like to make a panel, similar to "drop the file here"
Is it possible? Any suggestions?
Sorry for my English.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

i am not sure what you mean by "drop the file here"
you can use jfilechooser or the system clipboard


SCJP
Visit my download page
juan perez
Greenhorn

Joined: Feb 05, 2013
Posts: 4
something like this


------------------------------------------------------------------------------------------------



instead of a JFileChooser

Randall Twede wrote:i am not sure what you mean by "drop the file here"
you can use jfilechooser or the system clipboard
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

i think you mean use the clipboard.
i have just the thing for you.
i found most of it on the internet, i just made it a class.
this is specifically for images, but you can make it work.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

And if you don't want the clipboard to be involved, you can still use a similar technique using drag-and-drop. Google for java drag and drop tutorial and check out the Oracle tutorial. Based on the code you find there you should be able to do some experimenting and come up with a component where you can drop a file which was dragged from (e.g.) Windows Explorer.
juan perez
Greenhorn

Joined: Feb 05, 2013
Posts: 4

thank you very much.
Randall Twede tested the code and served me served me.
instead of imageFlavor I tested with javaFileListFlavor.
Paul Clapham thank you very much for your suggestion, I'll try, I think that is what I was looking.
 
jQuery in Action, 2nd edition
 
subject: alternative to JFileChooser (panel similar to "drop the file here")