aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes reference problem in drag and drop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "reference problem in drag and drop" Watch "reference problem in drag and drop" New topic
Author

reference problem in drag and drop

mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 245
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

Joined: Apr 05, 2005
Posts: 245
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reference problem in drag and drop
 
Similar Threads
not able to insert node after the last node in the leaf
Help please with drag and drop
TransferHandler exception for Mac OS
JFormattedTextField MaskFormatter issues: Please Help its urgent
Jcomponent in JTable cells