B4J Question Solved: [jDragAndDrop2] How to put files on the DragBoard

knutf

Member
Licensed User
Longtime User
How can I put files Using the jDragAndDrop2 library?
I can't figure out what parameters to use with the SetDragModeAndData sub to put a filepath\name on the DragBoard so that it can be detected by the HasFiles method of the DragBoard or by Windows Explorer.
 

knutf

Member
Licensed User
Longtime User
This works:
B4X:
Sub txtSource_DragDetected(e As MouseEvent)
        Dim f As JavaObject 
        f.InitializeNewInstance("java.io.File",Array(File.Combine(File.DirTemp,"MyFile.txt")))
        Dim files As List
        files.Initialize
        files.Add(f)
        DragDrop.SetDragModeAndData(TransferMode.ANY, Array As String("application/x-java-file-list"),Array As Object(files))
        Log("DragDetected : Starting drag")
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…