Welcome to Dream.In.Code
Become a Java Expert!

Join 150,037 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,593 people online right now. Registration is fast and FREE... Join Now!




Drag and drop in java

 
Reply to this topicStart new topic

Drag and drop in java, couldnt drop an image

susmitha
14 Jun, 2008 - 04:12 AM
Post #1

New D.I.C Head
*

Joined: 14 Jun, 2008
Posts: 2

HI
one more problem ....

how to drag an imageicon ad drop it onto a label i java swings ...

icon_down.gif
User is offlineProfile CardPM
+Quote Post

1lacca
RE: Drag And Drop In Java
14 Jun, 2008 - 04:32 AM
Post #2

code.rascal
Group Icon

Joined: 11 Aug, 2005
Posts: 3,822



Thanked: 12 times
My Contributions
Java DnD
Next tiem please post in the Java topic questions regarding Java, thank you.
User is offlineProfile CardPM
+Quote Post

pbl
RE: Drag And Drop In Java
14 Jun, 2008 - 01:47 PM
Post #3

D.I.C Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 3,587



Thanked: 233 times
Dream Kudos: 75
My Contributions
QUOTE(susmitha @ 14 Jun, 2008 - 05:12 AM) *

HI
one more problem ....

how to drag an imageicon ad drop it onto a label i java swings ...

icon_down.gif

easiest way ? Already put it in a JLabel (the user won't see that it is in the JLabel) and add a MouseMotionListener to that JLabel.
In the mouseReleased() method of the MouseMotionListener just move the ImageIcon to the new JLabel ad set to null the Icon of the old JLabel
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 09:45PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month