Results 1 to 1 of 1
- 06-20-2010, 07:44 AM #1Member
- Join Date
- Jun 2010
- Rep Power
Transfer drop to sub-component (need help with)
First of all, hello
My problem is this:
I've been messing with Swing and Drag and Drop functionalities for an application and learned a lot in a few weeks. I've managed to create color tiles that work with drag and drop; dragging the color from the color tile and dropping in another component that get's drawn with the chosen color. I wanted to display the components (lets call them drawings) in a list, and said list should support drag and drop. I've managed to drag the drawings from one list to another, and to add or remove more drawings with drag and drop.
But when I try to drag a color to a drawing inside a list, it doesn't work, the list is catching the drag instead of the drawing. Is there a way to transfer the drag to the drawing?
Note that some drawings use gradients, thus there is need to know where, in the drawing, the color was dropped. Also, the drag and drop of the drawings works just fine if they are outside the list.
I'm using a custom TransferHandler for the list (as well as a custom ListModel and a custom ListCellRenderer)
The color tiles and the drawings implement DragGestureListener, Transferable and DropTargetListener.
My code at this point involves a lot of classes so it is hard to show.
Thanks to everyone who take the time to read my problem, hope you can help me.
- By Vin in forum New To JavaReplies: 0Last Post: 02-03-2010, 11:53 AM
- By tomba in forum AWT / SwingReplies: 4Last Post: 12-09-2009, 01:01 PM
- By manabendra in forum NetworkingReplies: 2Last Post: 08-07-2009, 07:51 AM
- By anjali in forum Advanced JavaReplies: 1Last Post: 04-01-2009, 10:28 AM
- By Ada in forum AWT / SwingReplies: 3Last Post: 06-07-2007, 05:52 PM