Enabling Drag and Drop via GUI Form

I've constructed the basic UI that I need.

The outermost Component is a JFrame. It contains a JPanel which contains a JLabel. I need the JLabel to be a drop target.

I checked the customCreate box in the form builder for the JLabel. And inside the createUIComponents() method I added this code:

dropTarget = new DropTarget(dropLabel, new DropListener(conversionQueue));

DropListener is a class I wrote which implements DropTargetListener.
conversionQueue is a JList

The problem is that the dropLabel doesn't accept drops.

So my question is, what do I need to do to get this working? I have a feeling I'm not clear on how the generated forms actually instantiate the objects.


1 comment
Comment actions Permalink

Does your code works if you create the components yourself without using the
IDEA designer?



Please sign in to leave a comment.