Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] File transfer by Drag and Drop

Hello,
 
I have a swt table which contains several file
locations. I can transfer the files to a folder
(windows environment) by drag and drop of rows. I used
the table as the drag source. I need to know the
location where user drops the file. How can I know the
absolute path of the folders where user drops the
files?
 
 
   FileTransfer fileTransfer =
FileTransfer.getInstance();
   Transfer[] types = new Transfer[] { fileTransfer };
   int operations = DND.DROP_MOVE | DND.DROP_COPY;
   DragSource source = new DragSource(table1,
operations);
   source.setTransfer(types);
   source.addDragListener(new DragSourceListener() {
    public void dragStart(DragSourceEvent e) {
    };
    
    public void dragSetData(DragSourceEvent event) {
     event.data = new String[]
{table1.getItem(table1.getSelectionIndex()).getText(0)};

    }
    
    public void dragFinished(DragSourceEvent event) {
    }
   });
 
 
Thanks for your time.


Sajib
Software Engineer
Nilavo Technologies Ltd.



       
____________________________________________________________________________________Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz


Back to the top