Drag-and-Drop file import from filesystem?
Hello all, I'm new here and this is my first post.
I'm relatively new to java but am learning fast, and I'm familiar with the fundamental concepts. I mostly just need to get familiar with all of the graphics/GUI APIs for the application/applet Idea I'm working on.
The application/applet I am designing would greatly benefit from an ability for the user to import files by clicking and dragging them into a section of the application directly from the filesystem. My questions are:
- Is it possible in an application? (I'm pretty sure it is.)
- Is it possible in a web-based applet? (Again, I'm pretty sure it is.)
- What APIs am I going to need to use for this function? (what specific packages to import, classes and methods to use?)
I also have a few other questions for those willing to answer:
- How difficult is it to create an applet version of an application, and what are the general steps involved?
- How difficult is it to create a completely custom GUI based on graphics files, and what are the general steps involved?
Thanks in advance.
Re: Drag-and-Drop file import from filesystem?
Ha what a coincidence, today I've been working on the same thing! From what I have been reading DnD seems like the way to go.
Introduction to DnD (The Java™ Tutorials > Creating a GUI With JFC/Swing > Drag and Drop and Data Transfer)
Personally I found the code from the following link to be useful and it demonstrates that DnD can be used for files dragged from the file system:
Drag and Drop file path to Java Swing JTextField - Stack Overflow
Hope this helps,