Image as drop target for drag and drop

was wondering how I can make an image to be a drop target using the dnd api. so far from what i've seen it takes only java components to be target, so if anyone has any ideas it will be great.
thanks

I don't know why your DropTarget implementation doesn't work, but an alternative, more high-level way of doing what you want is to use a TransferHandler:
        canvas.setTransferHandler(new TransferHandler() {
            @Override
            public boolean canImport(TransferSupport support) {
                if (support.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                    support.setDropAction(DnDConstants.ACTION_COPY);
                    return true;
                return false;
            @Override
            public boolean importData(TransferSupport support) {
                try {
                    String text = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
                    System.out.println(text);
                    return true;
                catch (Exception ex) {
                    ex.printStackTrace();
                    return false;
        });

Similar Messages

  • More than one correct target in Drag and Drop

    Can an object have more than one correct target in a drag and drop? I have a question: Balance cost with _________ and ___________. The correct answers are interchangable. It doesn't matter which goes in which blank. Is it possible to tell Captivate that either would be a correct answer?

    Unfortunately, no. I need to be able to drag sources to both targets. I
    have two sources and two targets. It doesn't matter which source goes
    into which target for this statement. So I need it to be correct no
    matter which order the learner puts the answers.
    Shekhar_Dhiman <mailto:[email protected]>
    Tuesday, May 07, 2013 4:49 PM
    >
          Re: More than one correct target in Drag and Drop
    created by Shekhar_Dhiman
    <http://forums.adobe.com/people/Shekhar_Dhiman> in /Adobe Captivate/ -
    View the full discussion
    <http://forums.adobe.com/message/5298955#5298955

  • I have 9.0.1 on 2 pc's, both xp sp3. On 1 the 'open new tab' button is visible, on the other, the 'open new tab' button is not even available in the 'customize toolbar' menu for dragging and dropping. Why?

    I used the same installation file, but on 1 pc, the 'open new tab' button is available in the 'customize toolbar' menu and can be dragged and dropped onto the navigation bar. On the other pc, the 'open new tab' button/icon is not even available for dragging and dropping. I uninstalled firefox completely, including settings and preferences, then reinstalled, but that did not correct the missing button.

    Hi,
    Please try '''Restore Default Set''' in the '''Customize...''' window. If it's still not visible, one reason could be that the button is already placed on the toolbar but may be hidden behind another icon or toolbar.
    Useful links:
    [https://support.mozilla.com/en-US/kb/Options%20window All about Tools > Options]
    [http://kb.mozillazine.org/About:config Going beyond Tools > Options - about:config]
    [http://kb.mozillazine.org/About:config_entries about:config Entries]
    [https://support.mozilla.com/en-US/kb/Page%20Info%20window Page Info] Tools (Alt + T) > Page Info, Right-click > View Page Info
    [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard Shortcuts]
    [https://support.mozilla.com/en-US/kb/Viewing%20video%20in%20Firefox%20without%20a%20plugin Viewing Video without Plugins]
    [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder & Files]
    [https://developer.mozilla.org/en/Command_Line_Options#Browser Firefox Commands]
    [https://support.mozilla.com/en-US/kb/Basic%20Troubleshooting Basic Troubleshooting]
    [https://support.mozilla.com/en-US/kb/common-questions-after-upgrading-firefox-36 After Upgrading]
    [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins Troubleshooting Plugins]
    [http://kb.mozillazine.org/Testing_plugins Testing Plugins]

  • [svn:fx-trunk] 10876: Add support for drag-and-drop from Spark List to Spark List.

    Revision: 10876
    Author:   [email protected]
    Date:     2009-10-05 15:20:07 -0700 (Mon, 05 Oct 2009)
    Log Message:
    Add support for drag-and-drop from Spark List to Spark List.
    - List drop related handlers
    - LayoutBase APIs
    - VerticalLayout DND support
    Notes:
    - ListSkin is not final.
    - Drag-scrolling not yet implemented.
    QE notes: Only VerticalLayout works, HorizontalLayout still not implemented.
    Doc notes: None
    Bugs: None
    Reviewer: Deepa
    Tests run: checkintests
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/ListSkin.mxml
        flex/sdk/trunk/frameworks/spark-manifest.xml
    Added Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/DropLocation.as

    Whoops, disregard my question - I just read the spec that indicates drag and drop is scheduled for later work.
    David

  • My touch pad is no longer responding to hard press downs for drag and drop or copy and paste

    my touch pad is no longer responding to hard press downs for drag and drop or copy and paste ability

    may be a totally stupid question, but how can I tell?

  • Adding a target to 'drag and drop' code snippet

    Hi,
    I would imagine it's a simple enough bit of additional code, but I'm no programmer, and trawling the Web has proved fruitless to date...
    Within Flash CS5 and using AS 3, I'm attempting to create a series of drag-and-drop interactions for a learning exercise where items must be dragged into the correct box with positive and negative feedback being generated as a result of where the learner drops the item. All I need is the code to link the drag and drop code snippet (which I have working) to a specific object/location on the stage (which I cannot find nor figure out for the life of me)!
    I may be overcomplicating given that perhaps there is a CS5-compatible extension out there somewhere (whatever happened to all of the e-learning extensions and tools Flash once had if my memory serves?) which can provide me with an easily customizable template to achive what I need to do?
    Many thanks in advance to whomever can offer and tips, tools or usable code for this task.
    Galvoice.

    the easiest way to handle that would be to assign a transparent movieclip to the target position and use that movieclip as your droptarget.

  • Help on Final Step for Drag and Drop Exercise

    Does anyone know the best way to create a test item where the learner has to place a check mark in the correct cells and hit submit to succeed. 
    I was using a drag and drop  but I am lost on step three. 
    I am using the check marks as drag sources, square shapes located in all cells will the correct cell/box assigned as the correct drop target.
    The issue is when I get to step three, how do I allow the user to drag ANY checkmark (drag target) to the correct cell/box (drop target).  When I get to step 3, I have to assign each individual  checkmark to ONE specific cell/box and I want the learner to be able to drag any checkmark, as long as it is dropped in a designated drop target.
    If there is another way I should approach this test item instead of drag and drop, I am open to any suggestions.
    Here is an example:

    I purchased the Master Widget from Infosemantics a few months back but between my day job and my schooling for my ID Certification from UC Irvine Extension, I have not had the time to figure it out.
    I thought there would be an easier way but as usual, nothing is a quick fix anymore.  Even when you think your just missing a simple step.
    Thanks,
    Jeff

  • Select All in a table does not work for Drag and Drop

    Hi. I am using Jdeveloper 11.1.1.2 but have also reproduced in 11.1.1.3.
    I am trying to implement drag and drop rows from one table to another. Everything works fine except when I do a Select All (ctrl-A) in a table, the table visually looks like all rows are selected, but when I try to click on one of the selected rows to drag to the other table, only the row I click on is dragged.
    I tried setting Range Size -1, fetch mode to FETCH_ALL, content delivery to "immediate" but nothing works.
    I even have reproduced not using a view object but just a List of beans with only 5 or 10 beans showing in the table.
    Does anyone know how to get Select All to work for a Drag Source?
    Thanks.
    -Ed

    Frank-
    OK, thanks for looking into that. I also submitted this service request, which includes a simple sample app to demonstrate the problem:
    SR #3-2387481211: ADF Drag and Drop does not work for rows in table using Select All
    Thanks again for the reply.
    -Ed

  • How to set default object placement & wrap for drag-and-dropped files

    I am working on a document into which I need to drag-and-drop a number of files from the Finder: JPGs, PDFs, and so on. Each time I drag a file into Pages, by default its placement is set as "Floating (doesn't move with text)" and "Object causes wrap" is active.
    I would much prefer that the default settings be "inline" and "object does not cause wrap," so my drag-and-dropped images will appear within the text and move with it.
    Is there a way to change this default setting?

    Niel's suggestion is good. You might also try posting your question in the Tiger Server forums. I'm sure Tiger Server has several ways of dealing with this.

  • What is the policy for drag-and-drop in training mode?

    Hi,
    I've captured an application in training mode. It contains one drag-and-drop action which obviously is done in full motion recording.
    Only thing is, this doesnt work when you then do the simulation as a user.
    Can drag-and-drop working in this mode? It seems not.
    Can anyone advise?
    Thanks,
    Joan

    Hi there
    I'm guessing that you mean to ask if one is able to force a user to perform a drag-and-drop as part of a simulation?
    Unless you program it in Flash or some other application it isn't avaiable. Check the link below for more.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Any fixes for drag and drop not working in WAD with IE9?

    I have exactly the same issue as is described in WAD Problem - can't modify and Drag&drop in Web App Designer (WAD) doesn't work but unfortunately I don't have the option of going from IE9 back to IE8.  Has anybody found a fix for using drag and drop in WAD with IE9?
    Edited by: Jason Muzzy on Jul 22, 2011 1:09 AM

    Hi Jason,
    Thanks for replying .
    But I am facing this isssue in Web Application Designer. The link which I have shared shows the behavious of cursor while dragging and dropping
    Drop not allowed ("blocked traffic" sign)
    Drill across (arrow pointing to the right)
    Drill down (arrow pointing down)
    Exchange dimensions (exchange icon)
    Add to filter (add icon)
    Remove from filter (remove icon)
    Reorder list (reorder icon).
    This issue I am getting in Web Application Designer itself.In WAD 7.X ANALYSIS TABLE do we have any option from which we can disable drag and drop of cells because it is destroying the view of report output .
    In WAD 7.X we have option of Activate Navigation in ANALYSIS TABLE but if we disable this our context will get disable and it shows the default Browser context menu.We have not provided any such options so that its original layout will retain back .
    The solution they have mentioned to Disable Drag and Drop is not available in WAD ,its available in Analyzer.
    Please let me know if you have found any solution for this.

  • Why can't Mac users, who have multiple devices, have device icons for drag and drop, on desktop rather than iCloud, iTunes, etc. ?

    I want drag and drop in the form of icons on my iMac, from all my other Apple devices. I don't want to have to go through iCloud, iTunes and DropBox.

    What are you other apple devices?
    For an all Mac OS X set, you could write an applescript to perform the task.
    Robert

  • How do I get the student's answers to show on the next slide for drag and drop interaction?

    I'm working with Captivate 7 on a computer running Windows 8.
    I created a simple, one-to-one drag and drop activity using the  Drag and Drop Wizard.
    I want the student's answers to show on the next slide. Specifically, I want the drop source  to show with the drag target that the student connected to the drag source. This way the student can review his/her answers while the program discusses the correct answers.
    Is there anyway to do this?

    * You see the orange (on Linux gray) Firefox button if the Menu Bar is hidden (View > Toolbars > Customize or right-click a toolbar).
    * If you need to access the hidden Menu bar then press F10 or hold down the Alt key to make the Menu Bar appear temporarily.

  • Drop down box drag and drop storyboard

    Hello
    I'm trying to create an interactive storyboard using the drag
    and drop function to drag characters onto a stage so the user can
    arrange them however they wish. My problem is that now I have
    started this project I have realised I need a lot more images than
    first thought and have limited space as this is to go on a website
    and have the option to be printed.
    Therefore, I have been trying to create a dropdown menu with
    tabs with the character name on and when the tab is clicked a box
    with all that characters images appears below. Now I managed to
    make this work but then when you click between the tabs having
    placed the characters on the storyboard, if you click a tab in the
    timeline before the one you were on, obviously the character
    disappears from the stage. Is there anyway of creating a drop-down
    menu or something similar to save space, which can have draggable
    movieclips in?
    Also my second problem is does anyone know how to create a
    duplicateable movieclip. For example, once a character is dragged
    from the menu onto the storyboard, it is now only on the storyboard
    and there is only one copy. Now I know I could just make loads of
    the same character and layer them, but it would be much better if
    someone knew of a way to duplicate a movieclip once it is dragged
    away so that there is always one in the menu.
    Any help would be greatly appreciated as I am fairly new to
    flash and am trying my hardest to get to grips with actionscript.
    Cheers,
    Anna

    Thanks for your help but not too sure I understand most of
    it.
    Just working on duplicating characters at the moment and so
    far have managed to duplicate once but then can only move duplicate
    character and original disappears.
    This is the code I have on the movieclip at the mo - any
    suggestions very very welcome.
    on (press) {
    startDrag(this, true);
    duplicateMovieClip(this, newname="drag_clip_new", 2);
    on (release) {
    stopDrag();
    Don't know much about depth etc.
    Also found this code on the net but am having trouble
    changing it to fit my needs:
    var mcNum = 1;
    var dupli:MovieClip;
    mc1.onPress = function() {
    dupli = mc1.duplicateMovieClip("mcname"+mcNum, ++mcNum);
    dupli._x = mc1._x;
    dupli._y = mc1._y;
    dupli.startDrag();
    this._parent["mcname"+mcNum].onPress = function() {
    this.startDrag();
    this._parent["mcname"+mcNum].onRelease = function() {
    this.stopDrag();
    mc1.onRelease = function() {
    dupli.stopDrag();
    mc1.onReleaseOutside = function() {
    dupli.stopDrag();
    Again any help very welcome!

  • Is there a way to cut down on the "suction power" of the drop items in drag and drop?

    I am trying to develop a game where the user has to correctly space objects from one another depending on what their relationship to one another is.  The drop objects are actually completely transparent and the user has to place the drag item perfectly on top of it. The problem is that when the user doesnt place the drag object directly on top of the drop object, it nevertheless gets pulled to that object . 1.  I want there to be virtually no pull power.  2. I would also like the the user to be able to continuously click on the drop object and move it slightly until he thinks it is perfectly correctly, and the object stay where he dropped it -- I dont want it pulled back to its origin.
    If this is possible, please let me know!!
    Thank you!
    Ryan

    What you are referring to is called Snapping Behaviour.  In the Cp version of drag and drop, there's really no way to turn it off.
    If you are not intending to output to HTML5, you could trial Infosemantics Drag and Drop widgets.
    http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets
    The drag and drop widgets have the option to turn off Snapping Behaviour altogether so that your user can just place the object where he wants before submitting the answer. 
    Just remember that the target object is the drag object's 'hit' area. The way Flash hit areas work means that if the drag object touches any part of the hit area, this is counted as Success.  So the size of the hit area really determines how precise your user has to be in hitting the target.  It's not determined by whether or not the target and hit area are the same size and the user places the drag object exactly on top of the target.
    Teh video at the very bottom of this page shows an example where snapping is turned off:
    http://www.infosemantics.com.au/adobe-captivate/youtube-video-tutorials

Maybe you are looking for

  • Error when configuring Sender File Adapter (XI 7.0)

    Hi all, After i had configured my Sender File Adapter of Communication Channel 'CC_SEND_MATERIAL_FILE', an error message for this Communication Channel (in Runtime WorkBench/Component Monitoring/Adapter Engine/Communication Channel Monitoring) occurr

  • Using FCPX as a music editor

    Does anyone know if I can use FCPX to pull in an iTunes song and add beeps or similar for a workout track and share/export as an iTunes file again. Also looking to blend two songs together. Very basic stuff I know but free software is just useless. T

  • Roles activation from business content

    Hi Experts, i have activate a business content role  SAP_BW_SALES_MANAGE_ADMIN related to sd module,where can i find the activated business content role in bi.i have check in the query designer and analyser for the role,but i could not find it.where

  • Have to delete Magic Mouse from MacOS to pair with Windows Bootcamp

    Like many I couldn't get my Magic Mouse to pair in Windows when dual booting with BootCamp to Windows 8.1 on my 2012 MacBook Air. Whenever I searched for bluetooth devices it wouldn't be found, or would sporadically appear but fail to pair. The solut

  • IS THERE A T400 BIOS ARCHIVE?

    I bought a used T400 – this is my first Lenovo laptop. It has Win7 and the bios is ver. 2.16 dated 4/22/09. I see there is a newer bios available – 3.24 dated 2/07/12. I haven't experienced any problems running the current bios, but I haven't been th