Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
juan perez
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4363
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not sure what you mean by "drop the file here"
you can use jfilechooser or the system clipboard
 
juan perez
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4363
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20771
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic