title: Drag and drop image with TransferHandler
body: <p>I am trying to make simple java app to drag and drop image into JLabel which is on JFrame with no luck. I will later use this functionality in my program which will receive dropped image, resize it and then adjust brightness. What is simplest way to make it and to save that image for further editing?</p>
  
  <p>Here is my code which only receives dropped text:</p>
  
  <pre><code>import java.awt.image.BufferedImage;
  import javax.swing.JFrame;
  import javax.swing.JLabel;
  import javax.swing.TransferHandler;
  
  class DragNDrop extends JFrame {
          JLabel label;
  
          public DragNDrop() {
  
              setTitle("Simple Drag &amp; Drop");
              setLayout(null);
  
              label = new JLabel();
              label.setBounds(0, 0, 200, 200);
  
              add(label);
              label.setTransferHandler(new TransferHandler("text"));
  
              setSize(200, 200);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setLocationRelativeTo(null);
              setVisible(true);
      }
  
      public static void main(String[] args) {
              new DragNDrop();
      }
  }
  </code></pre>