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

Similar Messages

  • 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

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

  • Drag and drop snapping issue

    All-
    I have a symbol that i want to "snap" into place on a target
    everything works well but the snapping just kinda hangs out in the general area
    here's the code:
    yepnope({nope:['jquery-ui-1.10.3.custom.min.js', 'jquery.ui.touch-punch.min.js'], complete: init});
    function init() {
        //USING CUSTOM JQUERY INCLUDE CODE
        sym.$('GREEN-A-1').draggable({
        opacity:.5, revert:'invalid'
        //DROPPABLE ON TARGET
        sym.$('TARGET-GA1').droppable(
            {    //snap:'GREEN-A-1', snapMode:'inner', snapTolerance:50,
                accept:sym.$('GREEN-A-1'),
                drop: function(){
                    //sym.getSybol("GREEN-A-1").play();
                    sym.$('TESTGRP').show();
        sym.$('DEFAULT-GA1').droppable(
                accept:sym.$('GREEN-A-1'),
                drop: function(){
                    //sym.getSybol("GREEN-A-1").play(); //ONLY DO THIS IF ANIMATING SOMETHING INSIDE THE DROPPABLE SYMBOL
                    sym.$('TESTGRP').hide();
    i want the snapping to work like the fourth box in this expample
    http://jquery-ui.googlecode.com/svn/tags/1.6rc3/demos/draggable/snap.html
    also, is there an intuitive way to migrate jquery code examples i find on the web to edge?
    thanks

    I have an applet in a webpage that will accept drag
    and drops, however, if a user mistakingly drops into
    the browser page and not the applet, the drop is
    consumed, which is bad especially if you want an
    action to occur whenever a drop happens...
    :(Okay, but the applet provides a target area. So how is it any different from dropping said content on any other app that's in a background window? Make sure the drop area is visually obvious.
    Of course, if Firefox is taking this to be a file to show and then unloading the applet, that is not ideal. But I personally would not worry about such a thing happening that I felt a need to jump thru hoops to find a solution.
    In my opinion this would be a Firefox bug, but was
    wondering if there is a Java workaround. I guess I
    could tell people to just use IE.....You could restrict to IE other ways too, but I really don't see the point. I don't know any other way to change the type except what you already posted. FireFox does support running Java from within Javascript, so this might be a side effect of that.
    Message was edited by:
    bsampieri

  • Drag and drop Firefox issue

    I've encountered a rather annoying problem with drag and drop. Firefox will always accept a drop of a custom component! For example run and drag and drop in firefox:
    http://java.sun.com/docs/books/tutorialJWS/uiswing/dnd/ex6/DragPictureDemo.jnlp
    Do you know anyway to prevent this (I know IE does not accept the drop...)?
    Thanks very much for any input!

    I have an applet in a webpage that will accept drag
    and drops, however, if a user mistakingly drops into
    the browser page and not the applet, the drop is
    consumed, which is bad especially if you want an
    action to occur whenever a drop happens...
    :(Okay, but the applet provides a target area. So how is it any different from dropping said content on any other app that's in a background window? Make sure the drop area is visually obvious.
    Of course, if Firefox is taking this to be a file to show and then unloading the applet, that is not ideal. But I personally would not worry about such a thing happening that I felt a need to jump thru hoops to find a solution.
    In my opinion this would be a Firefox bug, but was
    wondering if there is a Java workaround. I guess I
    could tell people to just use IE.....You could restrict to IE other ways too, but I really don't see the point. I don't know any other way to change the type except what you already posted. FireFox does support running Java from within Javascript, so this might be a side effect of that.
    Message was edited by:
    bsampieri

  • Drag-and-drop in J2EE

    I need to implement the drag-and-drop feature within the same page on the same web browser using J2EE. What would be the best way to do it?
    Thanks!

    I'm not sure I completely understand what you are trying to do but if you are trying to create a web based user interface to a J2EE application and the interface must support drag and drop you may want to look at using a Java applet.

Maybe you are looking for