Drag and drop questions using image and painting

Hi all,
please apologize me if i'm posting a just discussed topic, but I couldn't find anything that could help me.
I'm trying to create an application where I've a Jtree on the left panel that contain entities that have to be dragged and dropped in the central panel (eventually pasting a representative image) as user decide.
I've just implemented all panels and jtree. I read java tutorial on drag and drop, but I don't know HOW i can paste image as objects that then i can manipulate in such a way that the user needs.
Do I have to use java.awt.dnd package?
Please, I'd like to receive some suggestion about.
Thanks in advance for your kindness.
Vincenzo

I'm sorry, I think that i've not been clear in my explanation. I don't know how to transfer by drag & drop an image (a node of a jtree) to a beside panel. I don't want to get code, it will be more appreciate suggestions on how to proceede.
I don't understand if I need java.awt.dnd package. On java tutorial I read that it shouldn't have to be used.
Thanks, I hope that I've been clearer now.

Similar Messages

  • Drag n Drop question

    hi. this is what i want to do:
    drag a file from a windows desktop, drop it into an applet that exists in a browser.
    the applet reads the local path and filename of the dropped object, and uses that to retrieve the file from the local system and uploads it via ftp to the server where the applet was downloaded from.
    i know how to do the basic drag and drop stuff, DropListeners and all, as well as the ftp transferring. but when i drop a Windows object into the applet in the browser and try to find out anything about it (with getTransferData()), i get exceptions thrown (InvalidDndOperationException).
    My question is: how can i get the path and filename of a Windows object dropped into an Applet existing in a browser?
    please reply to my email address if you can: [email protected] . thanks

    hi hool
    Can i ask you a question?? You seem to know a little more then me regarding Drag and drop. In my program i have actually got the basic stuuf working for drag and drop, in saying that i have added a source area to a panel and placed this at the north of my canvas , i have also created a target panel and placed it south to my canvas. SO now i can drag from the source area to my target area. What i want to do is when i hit a RUN button it goes and checks all the components in my target area and maybe carry out an action on what is there. Can this be done or am i just talking goobly gooke. Sorry i can't answer your question.
    Silla_34

  • Scoring a sequence/drag n drop question

    I had problems with this in CP4 and never figured out how to resolve them.
    In Captivate 5, I am using a sequence question.  Right now it has 4 objects and a total score of 100 points.
    I would like the user to be awarded 25 points for any answer that is in the correct spot.  I.e. if they have 1 and 4 right, they get 50 points, even if 2 and 3 are wrong.  As far as I can tell, it will only score you as 100 if you are right or 0 if even one is wrong.
    Is there a way around this?
    Thanks!

    Hello,
    Up till now this is not possible in Captivate with the default question slides. If you want partial scoring you'll need to construct the question slides yourself. I worked out an example in this article:
    Question slide with partial scoring
    However drag-and-drop will not be possible with custom question slides, unless you are willing to buy the drag-and-drop widget created by InfoSemantics.
    Lilybiri

  • Drag and drop questions in scjp

    hi all,
    i m planning to write scjp this month..
    can anyone tell me what 'drag n drop' questions like?
    and what kind of questions are generally asked?

    Well you can't change your answer for the drag and drop i mean you can but if you try to go back and try to see your question again for drag and drop then your answer is going to be deleted and then you had to redo the whole thing.
    So i suggest please make your decision at the same time. Drag and drop are not hard i mean something like this
    System.out.printf("Pi is approxmicately", Math.PI);
    Pi is approximately ______
    Place the value for PI 3.14
    3.145
    Something like that Good luck

  • Drag and Drop in a quiz

    Hi,
    I have a quiz in Captivate 7 that is using Submit All. Every question now has a "Clear", "Back", "Next", Submit All" button. I have created a drag and drop question using the new drag and drop functionality and selcted to include the question in the quiz. The problem is that I don't get the back, next or submit all buttons. I can use the Reset button and rename it Clear but Captivate has only added a Submit button, not a submit all button and I can't see how to change that or add the others.
    This quiz was originally built in version 6 and I used the drag and drop question widget from eLearning Bros but it doesn't work in version 7 and I'll need to publish this quiz in version 7.
    Thanks

    Hi there,
    Presently, you cannot add a Drag and Drop question as part of ‘Submit All'. Please file a feature request for the same in http://www.adobe.com/go/wish
    To add Back , Next buttons on a Drag and Drop question, Please add two button object on stage, Change the button text as 'Next', 'Back' and set actions as 'Go to Next Slide', 'Go to Previous Slide' accordingly.
    Hope this resolves the Next and Back button issues.
    Thanks,
    Nimmy Sukumaran.

  • Drag n Drop with Non-embedded Images?

    Hi,
    All of the Drag 'n Drop demos use an embedded image. For
    example:
    [Embed(source='someImage.jpg')]
    public var someImage:Class;
    // in the drag handler...
    var imageProxy:Image = new Image();
    imageProxy.source = someImage;
    And that works. However, this doesn't work:
    <mx:Image id="myImage" source="someImage.jpg"/>
    // in the drag handler...
    var imageProxy:Image = new Image();
    imageProxy.source = myImage.source;
    Am I missing something? Or is embedding mandatory?

    Hi,
    another idea:
    Go to analysis mode in your workbook.
    a) Select your analysis grid.
    At general tab -> activate "apply formatting" and "allow navigation".
    Refer here: [http://help.sap.com/saphelp_nw2004s//HELPDATA/EN/85/1321d0b7864766b5208a0b221a7608/frameset.htm]
    or
    b) Select navigation pane
    Activate "Allow navigation"
    Refer here:
    [http://help.sap.com/saphelp_nw2004s//HELPDATA/EN/85/1321d0b7864766b5208a0b221a7608/frameset.htm]
    Good luck
    Regards
    Edited by: Tobias on Jun 5, 2008 5:18 PM

  • Images resizing when using drag and drop

    We just recently got PS Elements 7. I have a blank image that is sized at 600 x 1662 pixels. When I want to put a photo into that blank, I make sure that the photo is 600 pixels high. With 6, what I used drag and drop from the bin, the photo fit perfectly. With 7 it is apparently resizing the photo and I have to stretch it to fit. Is this something that I have set wrong?  If I am making sure that both items should fit together based on number of pixels, why is one changing size? Something has to be changing size or the items would fit together. I am assuming that something is set wrong, because this just does not strike me a something that should happen, or the program is not a very efficient photo editor. If necessary I will go back to 5.0, although there are things that I like better in 7.
    jean @ buffaloworks

    I'm frankly surprised you had success with this in PSE 6, since the past two versions create a special kind of smart object from images dragged up from the bin. You can use copy/paste to create a regular layer, or you can drag down to a thumbnail in the bin from an open image, but the project bin doesn't let you drag up anymore, by design.
    Did you mean to say PSE 5 rather than 6? It worked normally there.

  • Drag and drop images using tilelist in flex

    i just want the working code for drag and drop images using
    tilelist in flex

    Try JDK 1.4 and call setDragEnabled(true)
    I will also post updated version of MediaChest soon using custom TransferHandler for DnD different types of Objects.

  • 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.

  • How to drag and drop href image from webbrowser to office using vsto c# wpf?

    I want to drag and drop href images from web browser to office using C# wpf. Is it possible to drag href images ? give me the solution

    Hi,
    Are you developing an Office Add-in application? Do you mean you hold a wpf Web Browser control in the Office Add-in project?
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Iphoto question. I have 8 images in an event. One is out of order. I have tried to copy and paste, and to drag and drop, but I cannot get it to move. Can anyone help?

    I have an iphoto question. I have 8 images in an event. One is out of order. I have tried to copy and paste, and  i have tried to drag and drop, but it won't move. Any help?

    IPhoto forum:
    https://discussions.apple.com/community/ilife/iphoto

  • Problem using text boxes as the "image" to drag and drop over audio file

    I have been adding audio files to my page in iWeb (previous version, not '08), but I am having a problem giving them titles.
    When you first drag a file from iTunes into iWeb, it provides a space for you to drag and drop a picture. The online iWeb guide also says that you can drag a text box there instead of a picture.
    I created a text box with the text I would like to drop over the controller. However, it is no longer allowing me to drop the text box there. I used to be able to do this, and I don't know what I'm doing differently now. Any suggestions?
    Thanks!
    -- Will

    foobar2000 with the ipod plugin will allow you to drag/drop FLAC files and when it syncs the ipod, it converts the FLAC files on the fly. MUCH better than dealing with the crappy iTunes interface and having to pre-convert the files. I absolutely loathe iTunes and it just gets worse and worse!

  • A question about drag and drop

    I have multiple images which can be dragged and dropped in a canvas. How can I get information about pictures into dataGrid, for instance the name and value (price) of an image? Currently my images are in array like this:
    private function init():void {
    currentExampleImage = imageExampleArray[imgExampleCurrentIndexNumber];
    private var imgExampleCurrentIndexNumber:Number = 0;
    private var imageExampleArray:Array =
    "assets/image1.png",
    "assets/image1.png"
    and they are run with loop like this:
    [Bindable] protected function get currentExampleImage():String {
        return _currentExampleImage;
    protected function set currentExampleImage(value:String) : void {
        _currentExampleImage = value;
    private function nextExampleImage(e:MouseEvent):void {
        if(imgExampleCurrentIndexNumber < imageExampleArray.length - 1)
        imgExampleCurrentIndexNumber++;
        currentExampleImage = imageExampleArray[imgExampleCurrentIndexNumber];
    else
        imgExampleCurrentIndexNumber = 0;
        currentExampleImage = imageExampleArray[imgExampleCurrentIndexNumber];
    So the question is that how can I set and get the name and the value of an image when it is dropped on a canvas and that information to be shown in a separate datagrid? Should I be using objects or classes? This is the drop function:
    private function doDragDrop(event:DragEvent):void
        var img:Image;
        if (event.dragInitiator.parent == whiteBoard)
            img = event.dragInitiator as Image;    
        else
            img = new Image();
            img.source = (event.dragInitiator as Image).source;
            img.addEventListener(MouseEvent.MOUSE_DOWN, doDragStart);
            whiteBoard.addChild(img);        
               img.x = event.localX - (event.dragSource.dataForFormat("localX") as Number);
               img.y = event.localY - (event.dragSource.dataForFormat("localY") as Number)
    Thanks beforehand and feel free to ask more information something is unclear.
    Message was edited by: SerpentChimera

    There's a separate empty datagrid in my application and the main intention is to make the information of each image (those dragged and dropped onto a canvas that is a designing area) being shown in the datagrid's columns Name - Quantity - Price. Those values should be obtained from each image but I'm currently unaware of the technique how the information could be added to the images.
    For instance Example1.png has a price value of 150€ and when that image is moved onto a canvas, the name and price should be shown in the datagrid and thus there should be simultaneous changes in the Quantity-column when I move the same image onto a canvas many times. Those images can also be removed from the canvas area and then the quantity should decrease. Obviously that same function should work on other images we have in a menu from where the images are dragged and then moved and dropped in the canvas. If I move Example1.png four times there should be Example1 in the name column, 4 in the quantity column and 600€ in the price column and of course all of them in the same row.
    Pay attention to the code I put into the first post. You may suggest better options how I can sort-of-import (couldn't invent better term) images to the application.
    Later there will be a row in the end of the datagrid/chart where the total price of every object that are moved on the canvas should be shown but that's another story.
    Hopefully this made some sense to the whole thing.

  • Is it possible to add a drag and drop interaction to a called image in a contaner?

    this forum is my last hope =( i know how to do drag and drop
    by itself, however right now i have my flash set up so that when
    you click BUTTON A, it does:
    on (release) {
    _root.gotoAndPlay ("photo1");
    once it goes to "photo1", on that frame, i wrote actions on
    the frame to:
    var myMCL:MovieClipLoader = new MovieClipLoader ();
    myMCL.loadClip ("images/heritageBrochureFront.png",
    "container_mc");
    stop();
    so it loads my picture into the container. my question, once
    the image it in the container, can i add drag and drop interaction
    to it? i would really love an easy solution.

    yes. there are a couple of ways to do this.
    one is the create a child movieclip of container_mc and load
    into that child and assign your onPress/startDrag
    onRelease/stopDrag methods to container_mc.
    a second way is to load into container_mc (like you're
    currently doing), wait until loading is complete (ie, use the
    onLoad method of an mcl listener) and then assign your methods to
    container_mc.

  • Drag and drop image into 2d Picture

    Hi All,
    I'm trying to implement a bit of "MS paint" magic for a customer's dialog. I want to be able to drag and drop into a 2d picture control. Ideally, I'd like to be able to move this around and resize it once it's there, but let's start with the first part - how to drag and drop from e.g. the desktop onto the 2d picture control. The rest is nice-to-have but unnecessary. 
    I've seen a clever example on here using a transparent path control, but that's not going to cut it here (I have other events linked with that picture box, e.g. right now I have a double-click event adding text to the image). 
    Thanks for any ideas... I've looked briefly into using the windows API (i.e. constructor nodes) but, there be dragons. 
    Solved!
    Go to Solution.

    pobrepablo1 wrote:
    Hi All,
    I'm trying to implement a bit of "MS paint" magic for a customer's dialog. I want to be able to drag and drop into a 2d picture control. Ideally, I'd like to be able to move this around and resize it once it's there, but let's start with the first part - how to drag and drop from e.g. the desktop onto the 2d picture control. The rest is nice-to-have but unnecessary. 
    I've seen a clever example on here using a transparent path control, but that's not going to cut it here (I have other events linked with that picture box, e.g. right now I have a double-click event adding text to the image). 
    Thanks for any ideas... I've looked briefly into using the windows API (i.e. constructor nodes) but, there be dragons. 
    Well, it is possible and I got it working . Let me clean it up, close my references, etc and I will post it. You will have to use the .net control though so hopefully that is ok. You could manage it for the labVIEW picture control with a mix of .net or winAPI to handle the drag and drop and see if it's over your picture control and then somehow get the path of the drag and load the path into the LabVIEW picture control. But, you may just want to stick with it all using the .net control
    CLA, LabVIEW Versions 2010-2013

Maybe you are looking for