• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java DND (Move Component with properties)?

 
Ranch Hand
Posts: 53
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All,

I have been working with Drag and Drop in Java for a little while now but I'm confused and dont know how to transfer my object along with it's properties properly using the Java DND library.

What I am atempting to do is drag one JPanel into another JPanel with all of it's properties. I have it dragging correctly no error's and I have a message box popup when the drop action happens but when the following code is called during the DND (if I have it open in debug mode) I start seeing things like DropTarget not available.



Can anyone please explain how I can properly transfer an exactly replicata of an object and it's properties using the DND library?

Here is the object I want to move from one JPanel to the Next:


Here is the JPanel I am trying to drag it to and should add the object to the layout:



If I am not being clear or if you have any questions to help me resolve this issue I would be glad to try and answer them. Any help is greatly appreciated!

Thanks
 
Chaz Branham
Ranch Hand
Posts: 53
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok so I believe I started making some headway with this a bit. Using a DataFlavor and using .importData on the transferhandler seems to only transmit data and not the actual object. I was able to make a simple example project that seems to support those assumptions but I still don't know how to pass the current object to the transferhandler. Back to researching... If anyone has anything to add I would appreciate any guidance.

Have a good one.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic