How to perform a Drag and Drop operation on JButton in a JPanel?

Hi guys,
There is a requirement to perform Drag and Drop operation on JButton component added to a JPanel Componet.
I could not get a proper solition to move the JButton component inside a JPanel component by drag and drop.
I request every one to provide some related information on moving a JButton component using Mouse operation.
Rajashekar.T

Here is some code for moving a window around the screen. The concept would be the same for moving a button around a panel:
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=599181

Similar Messages

  • RE : Drag and Drop operations between two outlinefields

    Hi,
    Has any one tried the drag and drop operations between two Outline widgets ina
    window.Any help appreciated.
    Thanks
    balsubHi Balsub,
    Here are some lines which can help you :
    First of all, your 2 OutLineFields must be in a draggable state.
    In the event loop of your window, you have to listen to the event
    ObjectDrop
    on the 2 OutLineFields :
    When Self.<MyOutLine1>.ObjectDrop(SourceX = SourceX,
    SourceY = SourceY,
    SourceField = SourceField,
    TargetX = TargetX,
    TargetY = TargetY,
    TargetField = TargetField) do
    When Self.<MyOutLine2>.ObjectDrop(SourceX = SourceX,
    SourceY = SourceY,
    SourceField = SourceField,
    TargetX = TargetX,
    TargetY = TargetY,
    TargetField = TargetField) do
    Then, when you receive this event, the LocateNode() method will give you
    the DisplayNode which is beeing dragged :
    (assume that your OutLineFields are mapped to the class named :
    ClassOutLine,
    and Col is an Integer which is not important here)
    TheSourceLine : ClassOutLine;
    Col : Integer;
    TheSourceLine = (ClassOutLine)((OutLineField)(SourceField).LocateNode(X
    = SourceX,
    Y = SourceY,
    Column = Col));
    If you want to remove this line from the Source OutLineField :
    TheSourceLine.Parent = Nil;
    TheSourceLine.UpdateFieldFromData();
    If you want to insert this line at the end of the Target OutLineField :
    TheSourceLine.Parent = (OutLineField)(TargetField);
    TheSourceLine.UpdateFieldFromData();
    And if you want to insert this line before or after the Target line of
    the Target OutLineField :
    TheTargetLine : ClassOutLine;
    TheTargetLine = (ClassOutLine)((OutLineField)(TargetField).LocateNode(X
    = TargetX,
    Y = TargetY,
    Column = Col));
    TheTargetLine.PrevSibling = TheSourceLine; // Insert the source line
    before the target line
    or
    TheTargetLine.NextSibling = TheSourceLine; // Insert the source line
    after the target line
    TheTargetLine.UpdateFieldFromData();
    I hope this help you !
    - Manuel -
    Manuel Deveaux
    Forte Developer
    Mutuelle Pr&eacute;viade
    FRANCE
    E-Mail : [email protected]
    -----------------------------------------

    There is no configuration for it. It should work.
    Can you try it in a different user account. If it works in a different account, then it is likely something in your current user account that is messed up. If it doesn't work in another user account, then it is likely something with Mail, itself. 
    You could try downloading and installing the 10.6.7 combo update. That may repair what is wrong.

  • Drag And Drop operations do not call custom IRM Protector

    We are developing our own custom IRM Protector, 
    So far we have successfuly integrated our IRM Protector into Sharepoint, and download operations and upload operations do protect and unprotect documents. Also move operations between libraries, through Send To ribbon action, call HrProtect and HrUnprotect
    methods as needed. 
    However, in our test environments, when using drag and drop operations between Libraries or folders, the IRM Protector is not being called at all. We have tried to update our test environments to the latest Cumulative Update, without success. Is there any
    known bug around the drag and drop functionality? 
    If true, Drag and Drop suposes a great security threat, and we cannot deliver our protection product to our customers, as it would mean document protections could be bypassed by a simple sharepoint operation.
    Thanks,

    We are developing our own custom IRM Protector, 
    So far we have successfuly integrated our IRM Protector into Sharepoint, and download operations and upload operations do protect and unprotect documents. Also move operations between libraries, through Send To ribbon action, call HrProtect and HrUnprotect
    methods as needed. 
    However, in our test environments, when using drag and drop operations between Libraries or folders, the IRM Protector is not being called at all. We have tried to update our test environments to the latest Cumulative Update, without success. Is there any
    known bug around the drag and drop functionality? 
    If true, Drag and Drop suposes a great security threat, and we cannot deliver our protection product to our customers, as it would mean document protections could be bypassed by a simple sharepoint operation.
    Thanks,

  • Regarding - Drag and Drop operations between two outlinefields

    Hi,
    Has any one tried the drag and drop operations between two Outline widgets in a window.Any help appreciated.
    Thanks
    balsub

    There is no configuration for it. It should work.
    Can you try it in a different user account. If it works in a different account, then it is likely something in your current user account that is messed up. If it doesn't work in another user account, then it is likely something with Mail, itself. 
    You could try downloading and installing the 10.6.7 combo update. That may repair what is wrong.

  • How to develop a drag-and-drop feature in JSF

    Can someone give me some hints about how to add a drag-and-drop featurn on a HTML page developed in JSF?
    For example, on Google personalized page, you can drag-and-drop some components and change their position easily. Can JSF do that, or even better?
    Any idea and help is appreaciated!

    You're looking for a portal software, with built in AJAX functionality...I'd love that kind of portal software as well.....you might want to look at Sun's portal software.
    Regards
    Haroon

  • How do I manually drag and drop songs from music library to iPhone 4 using iTunes 11?

    How do I manually drag and drop songs from music library to iPhone using iTunes 11?

    If you manually manage music... on iTunes 11, go to the top left corner and there will be a pull down bar. Click "show menu bar". From there, go to view, then show sidebar. Magically, it looks like the previous versions of iTunes. Took me 3 hours of trial and error and searching through forums to figure out. Tried calling Apple to have them walk me through it and they said they wouldn't help me since I don't have Apple Care. Whatever. Hope this helps!!

  • How to create a drag and drop video playlist Help please

    I would like to learn how to create a drag and drop video playlist.
    I think the most common example is youtube.
    I already have partial of the work but I am stuck with my preliminary knowledge of Flash.
    What I am saying is:
    I have a *.fla project that have the galleries for video and pictures.
    But this process is done from the back end.
    I would like to make it more dynamic for the visitors.
    For example:
    1. Create a visitor video (pictures) playlist
    2. Drag and drop into the playlist
    3. To be able to create different playlists (Playlist 1, "My favorite playlist", "Watch later", etc)
    If someone knows or want to guide me where or how to find this request, I'd appreciate it so much.
    If the forum think that this need to be address to a expertise ($). I am also welling to hear that and where to go.
    If someone is interesting in this project please send me a note to show the prelimary project.
    Thanks

    Yeah that is the general idea but that is more of a "lift and drop", i want to add the same thing as when you:
    Right click this window in the taskbar (assuming your using windows) when the window is not maximized and click "move" then it changes the cursor icon and allows u to move the window around and while you move it around it shows the window moving, not a click and release feature.
    So i want that ability without having to click on the title bar, if you know what i mean.

  • Which Listener I should use if I drag and Drop an image/icon into a JPanel?

    Dar Friends:
    Happy new year.
    I try to drag and Drop an image/icon into a JPanel, and hope I can immediately detect it after DND,
    Which Listener I should use in this JPanel if I drag and Drop an image/icon into a JPanel??
    Thanks

    Thank camickr .
    I can dnd an image into a JPanel called JPanelOld already, I hope to use another JPanel or JTree to listen to any Dropped Image in JPanelOld later on so I can take some action in another JPanel or JTree.
    so what kind of Listener I should use for my purpose??
    where to add this Listeners??
    Happy New Year.

  • Drag and Drop operation of SWT is not working in windows 7

    I have created VB script to elevate all administrator permissions to user and launched my application but not able to drop image to label in my application on Windows 7. It works fine if I remove User Account Setting (UAC). Please help how I can solve it.

    WTF? What are you talking about?
    Drag and drop of what from where to where does not work how?
    - What are you dragging?
    - From Where?
    - To Where?
    - What do you expect to happen?
    - What happens?
    - Why do you expect that to happen?
    - What technologies are you using?
    Basically, read [_How To Ask Questions The Smart Way_|http://www.catb.org/~esr/faqs/smart-questions.html].

  • How can I learn "Drag and Drop" with Swing components?

    Hello,
    Im using swing components, so using paint() to draw a "drag icon" doesnt seem acceptable. Im basically trying to move a JPanel image to be dragged/dropped over another JPanel in the same program/applet.
    I looked at Sun's Java Tutorial for information on doing drag and drop, but there was no trail completed yet.
    Does anyone know of any good resources to learn? Or can at least give me a general idea of how to do drag and drop?

    Did you see this?
    http://java.sun.com/docs/books/tutorial/dnd/index.html
    http://java.sun.com/docs/books/tutorial/reallybigindex.html

  • How to design a drag and drop between to containment references

    Hello,
    Can someone help me to desgin a drag and drop between two containment references shared by the same container ?
    I want two design this DND between two views : each is displaying one of the two references.
    I've tried to use for the target view an EditingDomainDropAdapter with generated item providers. But it is considering the two references as children features for the dragged element and the drop can then be done in the wrong reference.
    I've also tried to override generated item providers two only consider the reference viewed in the target view. But in this case the drag and drop command cannot execute because no parent is found for the dragged element.
    I've considered too put the item providers adapter factory of the source view in the dragged data, and design an EditingDomainDropAdatper using this factory for building the drag part of the drag an drop command. But it seems to be a big a job...
    So I prefer to ask your help to find the wright design for my need.
    Best regards,
    Laurent

    On 05/08/2015 8:44 PM, voiry laurent wrote:
    > Hello,
    >
    > Can someone help me to desgin a drag and drop between two containment
    > references shared by the same container ?
    >
    > I want two design this DND between two views : each is displaying one
    > of the two references.
    How did you achieve that result? By modifying the item provider's
    getChildrenFeatures(Object)?
    >
    > I've tried to use for the target view an EditingDomainDropAdapter with
    > generated item providers. But it is considering the two references as
    > children features for the dragged element and the drop can then be
    > done in the wrong reference.
    Yes,
    org.eclipse.emf.edit.provider.ItemProviderAdapter.getChildFeature(Object, Object)
    does that. That's why I ask how you specialized it to show only one of
    the features, because if you did it by specializing what's returned by
    getChildrenFeatures it should only consider the one reference, and not
    both...
    >
    > I've also tried to override generated item providers two only consider
    > the reference viewed in the target view. But in this case the drag and
    > drop command cannot execute because no parent is found for the dragged
    > element.
    I'm not sure specifically what you did, but getChildFeature should
    return your desired target feature...
    >
    > I've considered too put the item providers adapter factory of the
    > source view in the dragged data, and design an
    > EditingDomainDropAdatper using this factory for building the drag part
    > of the drag an drop command. But it seems to be a big a job...
    Seems not necessary. I imagine each view has its own specialized item
    provider, each returning the desired feature for getChildrenFeatures,
    and that all else should just work as a result.
    >
    > So I prefer to ask your help to find the wright design for my need.
    >
    > Best regards,
    > Laurent

  • How do I enable drag and drop of photos from a webpage to my desktop? It has stopped working and I cannot figure out how to enable it.

    I used to be able to drag and drop photos from webpages to my desktop but am no longer able to do so. I can however right click and save image as, but that it just to tedious.

    That sounds like a browser issue so what browser and what web sites?

  • How can I get drag and drop to work again in iphoto11?

    I have created a photo book in iphoto 11 (version 9.3.2) on my imac running os 10.7.5.  The drag and drop feature suddenly quit working. I cannot drag/drop photos from an event into the photo book OR within the photo book.
    I've restarted the computer to no avail. I've also quit and restarted iphoto.
    When I run Console, I see the following errors: iphoto: coredragcrete error -4960 and error in coredragdispose -1850
    What should I do to get my drag and drop working again?

    Repair permissions with Disk Utility.

  • Drag and drop operation resulted in files gone missing

    I would really appreciate some help as I have lost about 80 files. Here's what happened: I had a big folder of several hundred files and I was moving those files– photographs – into subfolders.I selected the photo in bridge and then used a drag and drop method to move it. It all went well except in two instances. One group of photos I dragged it to the wrong folder but when I searched I found them. Another group has gone missing. I have searched the whole computer for names of some of the photos in the missing group.it is as if they vanished into thin air. What could have possibly happened?
    Thanks in advance!

    I selected the photo in bridge and then used a drag and drop method to move it. It all went well except in two instances.
    I always use the drag and drop method and if it goes wrong I usually are to fast and don't wait for Bridge to have completed or I did not point to the correct folder.
    Without knowing what system you are on and what version of bridge you are using I agree with Curt that the files must be somewhere on your system (also check the Bin) and you better use a dedicated system search for it.
    And what is "group.it"? If I do a google search it stops without result and group.it also has not understandable  or related results?

  • How come I cant drag and drop images onto my imove

    I can't drag and drop images from my desktop or folder into imovie.

    Simply because you are not posting to the iMovie forum. Post there and find out.

Maybe you are looking for

  • Music skips and stops and starts

    Hello, we have just got a nano to replace a 3rd gen iPod. I have around 50 gigs of music on a lacie USB drive, and the music plays flawlessly from here in iTunes. However once imported into the nano, there is distortion, jumps and clicks in the music

  • Allocated memory pool was not deleted! 1 GB memory leak is too much for me!

    Dear Sirs. I found that DB environment, that was configured to use 1 GB cache size, won't free it when closed! Why? First I tried to open and close environment and got the following: Detected memory leaks! Dumping objects -> {596} normal block at 0x0

  • Creation of Insp Lot through FM QPL1_INSPECTION_LOT_CREATE

    Hi Guru Can any body help me to create Insp Lot through FM QPL1_INSPECTION_LOT_CREATE based on fields of Z-table for following data:- Z-table relevant fields INSCALLNO- INSPECTION CALL NO PSPID-PROJ DEFINITION OR PLANT PACKCODE-PACKAGE NUMBER (PO NO.

  • HT2499 How do I play DVDs on my MacBook Pro?

    I just recently got a MacBook Pro and never having owned one before in my life, I put in a DVD thinking it would play and it didn't. A DVD icon showed up on my desktop so I clicked on it and all there was were folders, etc. I didn't know what to do a

  • Wwdoc_document view

    Hi, I have exported and imported the portal30 schema in a new portal installation, everything worked and it's O.K. but the images from Content Areas are not there and can not insert another one neader the banner and other images be changed. The follo