title: Store custom object in JLabel on event
body: <p>I'm doing a drag and drop of custom objects into JLabels and am able to reference the object during the transfer process (change label String to received object toString), but unsure of how to actually store the custom object in the JLabel or build a reference. </p>
  
  <p>What is the best way to accomplish this during the transfer process? </p>
  
  <p>Here is the working transfer code that receives the object and uses it to set text (much thanks to a previous answer: <a href="https://stackoverflow.com/questions/13855184/drag-and-drop-custom-object-from-jlist-into-jlabel/13856193#13856193">here</a>:</p>
  
  <pre><code>public boolean importData(TransferSupport support) {
              boolean accept = false;
              if (canImport(support)) {
                  try {
                      Transferable t = support.getTransferable();
                      Object value = t.getTransferData(PersonTransferable.PERSON_FLAVOR);
                      if (value instanceof Person) {
                          Component component = support.getComponent();
                          if (component instanceof JLabel) {
                              ((JLabel)component).setText(((Person)value).toString());
                              //action here
  
                          }
                      }
                  } catch (Exception exp) {
                      exp.printStackTrace();
                  }
              }
              return accept;
          }
  </code></pre>
  
  <p>The JLabels have specific instance variables that I'd like to store them to. Since I have the component (JLabel) and value (custom object), can I make this link? </p>
  
  <p>Worst case scenario, I just have to build a TransferHandler for <em>each</em> label and reference the value exactly. Is this maybe best practice anyways? </p>