• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drag and Drop from JList to JTable.

 
Atrus Greyor
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to implement D&D so that I am able to drag items from a JList. The JList contains either text or images, and I want the image to appear in the cell. My problems are:

  • When I try to drag a text element, and drop it, a white square appears. If I double click on the cell, I can see the text element.
  • When I try to drag an image element, I can't. It won't even let me. It comes from the same list as my text elements, so I don't understand why I can drag items in the list that only have text, but not ones that only have an image.


  • Here is my TransferHandler....

     
    Atrus Greyor
    Ranch Hand
    Posts: 110
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Is any other information needed to help answer this question, I'm really stumped.
     
    Paul Clapham
    Sheriff
    Posts: 21117
    32
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Actually, yes. I was about to copy your code and try to run it, but then I noticed it used several other classes which you didn't post.

    I'm not suggesting you should post those classes, though. I'm suggesting you should make a shorter example which exhibits the problem and which can actually be compiled and run by somebody else.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic