Drag-n-drop in applet....

Hi everybody!
I really hope someone might be able to help me with this!! I have an applet with a GUI. In the GUI I have a JTree and a "working area" (JPanel). I want the user to be able to select a component in the tree and drag it onto the area. When the user lets go, the object appears in the area as a (draggable) UML object.
The problem is the drag-n-drop part. How do I do this?!?! I have to keep the JTree and JPanel in the same object container, right? I've tried making functions for dragging the UML object around inside the working area, no problems. But when I try to drag something between an area and a tree, nothing works. Do I have to have a specific panel in which I include both the JTree and the working area, or? Does anyone know how this might be solved, or have you seen any example of this?!?!
Very grateful for help!
/ jezzee

hey jezee,
i am also trying to do the same thing, only my drag and drop can also be from the work area to the JTree. I am still trying to understand the process. I have implemented DnD in just the JTree.
Can you send me the part of your code which involves the drag and drop, just to get an idea. Did you finally get an answer to your question? if so, can you please share the solution with me. i would really appreciate that. I will do so too, as soon as i find the correct way to implement it.
You can email me at [email protected]
Thanks very much,
sk.

Similar Messages

  • Drag and drop in Applets

    Is it possible to use the drag and drop APIs in applets?
    thanks jim

    Hi Jim,
    I would recommend using the Java plugin for your applets, and as such the answer is yes - especially if you use 1.4 then your Swing components are very easily transfered as a default!
    Hope this helps.
    Regards,
    Matt
    Java Developer Technical Support
    Sun Microsystems

  • Drag and Drop in applet

    Hi,
    I have trawled through the archives and noticed that this topic has been raised a number of times, but seemingly without any solution.
    Using drag and drop in an Applet causes a deadlock during the drag if repaint() is called in dragOver(). I run the same code in an application and it is fine. I assume the threads are not being released somewhere?
    Has anyone experienced similar, or have any workarounds or solutions?
    Thanks in advance for any help,
    Dylan.

    plz send me ans

  • Drag n Drop in Applets

    Is the java.awd.dnd package available to Applets? I would like to build an applet with drag & drop functionality.

    Dragon Droppings?
    Hmmm...I don't see why not, but there's only one way to find out.
    Try it!

  • Drag n Drop in JTree

    Hi,
    I am working on a prototype that requires drag and drop operation on a JTree. My applet requires to drag a item from the list into a JTree. I could achive this in the Frame and appletviewer, but when it comes to browser the drag and drop does not take place. I would appreciate if anyone could give a solution to this.
    Thanks,

    Does anyone of you able to work with drag n drop in Applet.
    I am not able to achieve that,if someone has done that do help me.
    Moreover we need to specify some security privileges if we need to run the drag n drop in an applet isnt it??
    how to do that. in browser specialy. How to use the policy file?
    thanking in advance

  • Safari for Mac, webpage with Java applet, drag and drop area not working.

    At my company, we have a web page that our users access to submit media files, (QuickTime, Audio, images...), for transcoding for delivery.  The web page consists of a java applet, with an area that our users drag and drop media file into.
    After updating to Safari 5.1.2, the applet will not work anymore. Instead, the browser will "open" the quicktime and play it, instead of allowing the Java Applet to do it's job.
    CAN I TURN THIS FUNCTIONALITY OFF??
    I read that Safari 5.1.2, (when it was initially released), broke something with the THEN current version of Java, and everyone was awaiting the latest update (build 1.6.0_29) to fix it. Unfortunately, this update did not fix my issue with the functionality of dragging and dropping media files into the web page.
    It seems to me, as if, there is an over-arching functionality setting (or something) that needs to be either turned off, or in some other way DE-prioritized.
    Anyone have any ideas?
    Safari 5.1.2
    MacOS 10.6.8
    MacBook Pro

    Thanks for quick reply and help. I am able to drag multiple files but this is giving problem in case of filename with spaces like "abc def.png". Can you please put some thoughts on this.
    DataFlavor uriListFlavor = new DataFlavor("text/uri-list;class=java.lang.String");
                   Reader in = (Reader)t.getTransferData(DataFlavor.plainTextFlavor);
                   BufferedReader br = new BufferedReader(in);
                   String uriStr;
                   while ((uriStr = br.readLine()) != null)
                       URL url = new URL(uriStr);
                       String category = GalleryUtils.contentsPanel.getCurrentCategoryPath();
                       GalleryUtils.generateILPFromFile(new File(url.getFile()), category);
                   }Thanks
    Kanni

  • Firefox: Drag and drop access revoked if open the same applet in new tab

    I have an uploader application that allows for drag and dropping of files from the desktop, works great. In Firefox 3, if you go to the uploader and drag files onto it it works, if you then open a new tab in the same window and navigate to the URL that contains the application you can drag and drop files into that new application window, if you go back to the previous tab however you can't drag and drop files on to that instance of the app anymore. Is this a known issue?
    Thanks,
    Sam

    This is an applet?

  • How Do I Drag and Drop Images From Windows Explorer to Applet?

    I'm not able to Drag and Drop Images and other files (like audio and video files) from Windows Explorer to Applet. Is that Possible to do so?. Can SomeOne help me out regarding this? Thanx in Advance.

    No problem here. Can you say any more about the situation?
    Jerry

  • Drag and Drop in CSS Styles Panel

    So, I am going through Dreamweaver CS5 Classroom in a Book. In lesson 6, pages 106 through109, it tells you to drag and drop rules in the CSS Styles Panel into a certain order.  I can't seem to get it to work for me.  Am I missing something?

    What do u mean by saying this?? Drag & Drop is possible for
    components example Jtree , jtable .These are placed on containers like JApplet, Applet or frame .
    So the answer is yes !
    there is a seprate package devoted to Drag & Drop.

  • When i drag and drop an image on my site. it gives the following error. "Unable to access local files due to browser security settings. To overcome this, follo"

    I am using the firefox version 17 and when i drag and drop an image on my website. It gives me the following error.
    Unable to access local files due to browser security settings. To overcome this, follow these steps: (1) Enter "about:config" in the URL field; (2) Right click and select New->Boolean; (3) Enter "signed.applets.codebase_principal_support" (without the quotes) as a new preference name; (4) Click OK and try loading the file again. Or go to the homepage for a link to the tutorial on how to do it.
    I have completed the above steps and it is still showing the same error message. Any help would be highly appreciated.
    Thanks.

    Thanks kumars ,
    I have a specific drag and drop area on our website. This works fine for all earlier releases of Firefox after these security settings
    "(1) Enter "about:config" in the URL field; (2) Right click and select New->Boolean; (3) Enter "signed.applets.codebase_principal_support" (without the quotes) as a new preference name; (4) Click OK and try loading the file again."
    Bust these settings not work for me in Firefox 17.
    Yes the drag and drop functionality is java script based and i am not using any script blocker addons.

  • Drag and Drop file from a jsp to local machine

    Hello All,
    We have got a user requirement where, currently we have an attachment section in our JSP, where users are provided with the file download links,
    as the user clicks those links the file download pop appears.
    But now they ask for a drag and drop functionality, so that the link icon which they see on the JSP, if they drag it to there local machine, the file is downloaded
    to the machine. Am not sure if it can be done from a web page. Any ideas if at all this is feasible. Or any direction where i can look through.
    Thanks,

    duskandawn wrote:
    But the other way around of dragging file which is on server, to the local machine...even if i have applet.. not sure how will that work.Neither am I. Just check the documentation / forums associated with the UI framework in question. This forum is for JSP/JSTL only. I can only tell how to embed an applet or webstart app in JSP, but nothing more than that.
    Any ideas around Activex stuff if any ?Terribly bad idea. It's a MS proprietary technology and it would work in only one certain webbrowser developed by the same company, so you would exclude about 40% of the world wide web population from using the functionality. Just use the standard technologies.

  • Drag and drop in webpages

    Hi all. I'm playing a football manager game on the Internet and I need to drag and drop players from one place to another. I was wondering if there was any way of holding my iPhone screen so I can drag and drop.
    Thank you.

    What do u mean by saying this?? Drag & Drop is possible for
    components example Jtree , jtable .These are placed on containers like JApplet, Applet or frame .
    So the answer is yes !
    there is a seprate package devoted to Drag & Drop.

  • Drag and Drop in a JTextArea (JTextPane)

    Hello everybody!
    I�ve a litte problem. I�m writing an online HTML-Editor as an Applet.
    Everything works fine, only drag&drop isn�t implemented yet.
    I�m using a JTextArea and a HTMLEditorKit in a SplitPane.
    Now i want to add drag&drop to each Pane. I need it urgent in the HTMLEdtiorKit , because it should be possible to drag and drop pics and text in the same pane.
    How can I add these feature ?!
    Maybe someone could write me a little example for a jTextArea oder a HTMLEditorKit ?!
    I�m actually using JDK.1.3.1, is there a big difference between 1.3.1 and 1.4 ?!
    Thanks,
    Ren�

    for those interested (if there is), i've given up on leadselectionpath, and i draw my outline manually, by overloading paintComponent and using the getPathBounds method.
    still, i don't know what leadselectionpath means... well, i guess i don't need to know, but if anyone want to share his knowledge...
    nicolas

  • Drag and drop to safari

    Hey,
    Im developing a java applet with "drag and drop" capabilities. However when i try to drag something on it in safari, safari just tries to open the files. It used to work, and when tried on other computers it does work properly. So some settings seems to be wrong on my computer. However im unable to find any such settings. Im still a rookie at using Mac OS, but havent been able to find any solution googling this.
    In addition Chrome will simply download any filed dragged into the Chrome window. Only Firefox seem to work properly. And again, it works on other computers so its not the applet not working but some settings somewhere that are off, the question is where?

    Thanks for reply!
    Can't find any helpful settings in 'java properties', I don't think it's a problem with my java settings. It feels like Safari overrides the drop-property of my applet, I get the same cursor (with the green '+') as when I drag and drop files in finder.

  • Drag and Drop to native desktop

    I'm working on drag and drop functionality to and from the user's computer. I have the "from" part working just fine, it's the "to" part that is stumping me. The idea for this applet is that it represents a file structure that is up on a remote server, so none of the files are local. If the user drags a file in, I can easily start an upload to push the file up to the server. However, when the user drags an item from the applet to their desktop or whatever folder, the only way to get this to work is to mimic a file, even though there is no file. What I would like to do is have a droptarget listener set up for the OS that will do everything I normally do within the applet (accept the drop, download the file, store it to the appropriate location). unfortunately, i haven't found any documentation on how this could be done. it looks like the OS wants a List of file objects that it simply copies to whatever destination you drag to. I don't see a way to capture where the file is being dropped, or how to maybe place a dummy file while the download is in progress and then replace the dummy file with the real file. Any advice or direction would be greatly appreciated.

    i'm not sure i get the JavaScript references...
    possibly i can re-phrase the problem in a much simpler fashion that could possibly solve my problems. In a drag-and-drop operation from a java application to the native OS, is there any way to know the context of where your transferable data is going? for instance, is there a way to know that the component i'm dragging is going to the Desktop versus "My Documents"?
    If there is a way, I could do some back-door coding so the user appears to be instantly get the file, while in the background the file is actually downloading and will replace the 'dummy' file when the download completes.
    Is that possible?

Maybe you are looking for

  • Why Does Spongebob Typing Work at Apple Store But Not at Home?

    I had read reviews warning that The Learning Company/Broderbund/Encore SpongeBob Typing was incompatible with Leopard and/or Intel Macs. When I went to my Apple Store to get some typing software for my daughter, they recommended the app to me, and I

  • Can you use find my iPhone with iPad and iPhone and the same icloud account for both?

    I have an iPhone and iPad. I use find my iPhone for both. If I use the same icloud account for both, how do I separate them on the map, or if I lose one and want to remote wipe the lost one but not the one in my possession?

  • Is there an itunes for me?

    I have windows 98 yea it stinks but its all I could aford at the time is there an itunes for me?

  • Locking Schema Owner account in oracle

    Hi One of the oracle security policy recommendations is to lock the owning schema in the database. To overcome this issue I suggested to the developer that I can create a new access account with permissions to select ,insert,delete and update data on

  • Cant change field names

    I am working in the hierarchy and re-naming fields names for reference when pointing to them in scripts. Everything has been working fine for days now. Now for some reason I cannot re-name an object. I am allowed to highlight the object, delete the e