posted 15 years ago
I've got a JTree as a drop target. I can drag leaf elements around within the tree just fine, and the cursor changes as appropriate when it's over a legal vs. illegal drop location. I have another drag source which is a JList in the same layout. I can drag from there and successfully drop onto the JTree (the list is NOT a drop target, btw). However, the cursor never changes when the drag is from the JList, it always shows a no-drop icon. I can drop, and the elements are successfully copied, but the cursor never changes. What am I doing wrong here?
I also want to control the type of cursor shown based on the drag source. If the drag comes from the JList, it will only ever be a copy, never a move. Hence, I want to always show the copy cursor, regardless of what meta-keys the user may be using, attempting to change the type of drag and drop. The intra-JTree DnD, however, can be either a move or copy, as normal. Can I accomplish this at the Swing level, or do I have to resort to an AWT solution? Can the two live together?
Thanks!
Brian
Two wrongs don't make a right... but three lefts do.