• 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

reference problem in drag and drop

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

i add some ButtonComponent on a jpanel.
ButtonComponent extend jbutto and have an object who have some property.



in the getCommand function of my ButtonComponent i do


it's like i have a reference problem because when i drag a component, change property of object, i drag another one... object property have same values then the first one.

any idea?

thanks
 
mark smith
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
instead of used this code

String mimeType = DataFlavor.javaJVMLocalObjectMimeType + ";class=" + CommandBeans.class.getName();
DataFlavor dataFlavor = new DataFlavor(mimeType, "command");



in my Transferable, TransferHandler class

i used

DataFlavor dataFlavor = new DataFlavor(CommandBeans.class,CommandBeans.class.getSimpleName());



that seem to have fixed the reference problem.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic