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.
Thanks.
请先登录再写评论。
Does your code works if you create the components yourself without using the
IDEA designer?
Tom