daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Dec 13th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         swing.edt {
  2.             frame(  id: 'mainFrame',
  3.                     title: 'title',
  4.                     defaultCloseOperation: JFrame.EXIT_ON_CLOSE,
  5.                     show: true,
  6.                     size: [300, 300]) {
  7.                 textLabel = label(text:"Drag file here", constraints:BL.NORTH)
  8.                 mainFrame.dropTarget = [
  9.                         drop: { dtde ->
  10.                             def t = dtde.transferable
  11.                             if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
  12.                                 dtde.acceptDrop(DnDConstants.ACTION_REFERENCE)
  13.                                 t.getTransferData(DataFlavor.javaFileListFlavor).each {
  14.                                     println it
  15.                                 }
  16.                             }
  17.                         }
  18.                 ] as DropTarget
  19.             }
  20.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top