• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Drag and Drop from JList to JTable.

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Is any other information needed to help answer this question, I'm really stumped.
     
    Sheriff
    Posts: 28372
    99
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic