Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

really confused about Data Flavors used for drag and drop

 
Philip Persson
Greenhorn
Posts: 20
Firefox Browser Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Transfer Hander as follows:



What I want to do is drop files onto a JTextArea and have it read the file name. It sounds simple enough but it is not because I am crossing the JVM boundary. Because I want to use native data types in the JVM it gets more complicated. In the routine I have specified my data flavor as "javaFileListFlavor" but that will never fly because I am getting data from the OS. By the way, this will be a multiple-platform application (Windows, Linux, Unix, Macintosh).

The error I get is as follows: Unsupported Flavor, application/x-java-file-list

I have read quite a few articles on this, I see that I need to somehow construct a FlavorMap using SystemFlavorMap by calling something called getNativesForFlavors which returns a map of flavors. Now, look here what it says about this map:

The Map object returned by both methods may be mutable but is not required to be,
these mappings are held in an external persistent configuration format and are loaded
from the platform to configure the FlavorMap appropriately for a given platform.


Say.....WHAT???

Does anyone have some clear examples of code that uses this? I am really confused at this point as to how I can bring this all together.

Thank you in advance for any help you might be able to offer or guidance to lessen my confusion
 
Philip Persson
Greenhorn
Posts: 20
Firefox Browser Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there are no replies does that mean I am the first to venture into this territory? Am I a pioneer?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic