• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add Drag and Drop functionality to JPanel?

 
Matt Senecal
Ranch Hand
Posts: 255
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to add drag-and-drop functionality to a JPanel. Specifically, I want to create a JPanel that accepts drops of other Components. In looking over the documentation and example code, it seems that I need to implement a custom TransferHandler for the JPanel, but I'm a little confused as to how to start. Can I just do a


Does anyone know of an existing example of how to do this? I'd appreciate a push in the right direction.
Thanks!
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could give you help pre 1.4 but as I understand it with 1.4 you only need to set some variable to TRUE and it will start accepting drops.
Of course its got to be able to understand what its receiving somehow. I haveent looked into the 1.4 architecture.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you run across Sun's Java Tutorial on Drag and Drop?
 
Matt Senecal
Ranch Hand
Posts: 255
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, and it was very high-level.
Originally posted by Dirk Schreckmann:
Have you run across Sun's Java Tutorial on Drag and Drop?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic