Drag an item from JList
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Salima_Lalani
Posted On:   Thursday, July 3, 2003 06:38 AM

Hi I am trying to create a JList with icons and wants to drag the elements from the JList to the panel. I am using the setDragEnabled(true) which enables the dragging and i can drop the list element on TextArea. But i want to drop the element on the Frame or Panel and i should be able to drag that element anywhere on the panel. Is it possible to add mouse listener and mouse motion listener on individual members of list. For e.g. if JList contains A, B, C , D so is it possible to add listeners on each elements? I tried with labels. I created the labels and added mouse listener and mousemotionlistener. I can drag the labels anywhere on the frame. Is it possible to have the same functionality in Jlist. Any example would be    More>>


Hi


I am trying to create a JList with icons and wants to drag the elements from the JList to the panel. I am using the setDragEnabled(true) which enables the dragging and i can drop the list element on TextArea. But i want to drop the element on the Frame or Panel and i should be able to drag that element anywhere on the panel. Is it possible to add mouse listener and mouse motion listener on individual members of list. For e.g. if JList contains A, B, C , D so is it possible to add listeners on each elements?
I tried with labels. I created the labels and added mouse listener and mousemotionlistener. I can drag the labels anywhere on the frame. Is it possible to have the same functionality in Jlist.



Any example would be of great help.


Thanks


Salima

   <<Less
About | Sitemap | Contact