Closed Bug 588455 Opened 14 years ago Closed 7 years ago

Drag and drop onto Java applet not working

Categories

(Firefox :: General, defect)

4.0 Branch
x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: eric.arlotti, Unassigned)

Details

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b5pre) Gecko/20100818 Minefield/4.0b5pre
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b5pre) Gecko/20100818 Minefield/4.0b5pre

Minefield 4.0b5 pre on Mac OS X 10.6.4 on iMac Intel Core 2 Duo 2,4GHz

It is not possible to drag and drop files from Mac OS X Finder onto a Java applet embedded in an HTML page.
This applet has drag and drop capabilities that work well under Safari 5 or Firefox 3.6.x. This applet is a signed applet.



Reproducible: Always

Steps to Reproduce:
Unfortunately, access to web page in which this applet is embedded is protected by a login, so there is no way to try it.
Actual Results:  
Files dragged and dropped from Mac OS X Finder onto the Java applet interface are not "accepted" as dropped files (as if drag and drop was not handled by this applet which is not the case).

Expected Results:  
Under Safari 5 or Firefox 3.6.x, the same Java applet accepts files dragged and dropped from Mac OS X Finder, so I expect the same result on Firefox 4.
Can confirm this issue and I'm running FF 4.0b6 at OSX 10.6.4 on a Mac mini with Intel CPU.

Environment:
- Applet compiled with java 1.6 and signed
- Embedded in a html page
- The drop listener is realized with a implementation of java.awt.dnd.DropTargetListener

I'm facing the same problem Eric does. The dragged files from the Finder don't get accepted by the applet. The applet is working fine with FF 3.6.12 at the same machine. The containing web application is running behind a firewall, too. So I can't provide a example right now.
This attachment is a ZIP file containing a simple Java applet that should demonstrate bug 588455. I have confirmed that the bug persists in the 4.0 release and in 4.2a1pre, which I just downloaded today.

I have included the applet's source code, and an HTML file to display it in a browser.

Steps to reproduce bug:

1. Load index.html into Firefox 4 on Mac OS X, which shows the test applet.
2. Drag any file from the Finder onto the "--> DRAG HERE <--" text label.
3. When the mouse-drag is over the text label, it should change to "LET GO!", and when the drop is completed, the lower part of the applet should show information about the dragged file. But neither of these things occur, because the java applet never receives any drag or drop events.

But if you try this on Firefox 3.6, or Safari 4, all is well.

The applet class also has a main method, so you can double-click DragDropTest.class in the Finder and it will launch as an application, thus bypassing the browser (and the bug).
More information about my test environment:

- Firefox 4.0/4.2a1pre
- Mac OS 10.6.7
- Java 1.6.0_24 (64 bit)

The test applet I attached is not signed. Even an unsigned applet can accept a file drag event. It just can't act on it (i.e. open the file). So this problem has nothing to do with signed applets.

I meant to say that the test worked on Safari 5 above, not Safari 4. It also was using 64 bit Java.

Java Preferences are set to run the JVM in the browser process. Interestingly, if Java is run in its own process, drag and drop events are ignored in ALL browsers.
I now see that submitting a JAR and HTML file separately is more useful than a ZIP, so here is the JAR. This JAR has Main-Class defined in its MANIFEST file, so it can be downloaded and double-clicked in the Finder to launch as an application outside of the browser (which of course won't exhibit the bug)
HTML that loads the attached applet JAR and exhibits the bug on Firefox 4 on Mac OS X
Attachment #523725 - Attachment is obsolete: true
Apologies for the flooding. To summarize my sprawling comments:

Environment:

- Mac OS 10.6.7 on Dual Core Intel Xeon
- Firefox 4.0, but also Minefield 4.2a1pre
- Java 1.6.0_24 (64 bit, running in browser process)

Steps to reproduce:

- Visit attachment 523750 [details] on Firefox 4 on Mac OS X, which loads a test applet
- Drag any file from the Finder onto the "--> DRAG HERE <--" text label

Expected results:

- During the drag, when the mouse is over the "DRAG HERE" label,
  the label should change to "LET GO!", indicating that a drop is possible.
- When the file is dropped on the label, the lower portion
  of the applet should show the path of the file dropped and details
  of all the "data flavors" present in the drop event.

Actual results:

The applet never receives the drag or drop events, so the label never changes to "LET GO!" and it isn't possible to complete the drop of the file.

Where the test does work on Mac OS X:

- Safari 5
- Firefox 3.6.16
- If you download the JAR (attachment 523749 [details]) and double click it to open it
  as an application

but note that for it to work in ANY browser, you must have your Java Preferences set to run applets within the browser process, NOT in their own process. If they run in their own process, drag and drop events are ignored by applets on ALL browsers.

The source of the applet is inside the JAR (attachment 523749 [details]). It uses AWT exclusively (no Swing), and is NOT signed, as there is no need for a signed applet as long as the dragged file is not opened by the applet.
Hello,

Just to confirme the problem. The drag and drop is not working on mac with FF4.

Here's a demo exemple of a java applet you can try to replicate de problem :

http://demo.aurigma.com/ImageUploader7/BasicDemo/Default.aspx
As of today the drag and drop in this app does not work.

I also found other apps like wiredrive and jumpuploader who have the same bug.


We also have the problem here and it's causing a lot of problem with our clients who are using mac and FF4.

I would like to see the priority of this going up. This is a major blocker for many apps.

thx!
I upgraded my FireFox extension to FF4. It doesn't use any Java. Drag&Drop worked without changes on Windows 2000, but not on OS X 10.5.8. The ondragover event happened, and the event.preventDefault(); function was called, but the ondrop event didn't happen.
I added 'var DropEffect=event.dataTransfer.dropEffect;' into the ondragover event handler and it is now working. The event handler did not previously use the event.dataTransfer object. My guess is that touching the event.dataTransfer object made the difference, as the DropEffect variable is never used.
Can also be observed at http://www.jfileupload.com/products/demo/applet_http.html drag and drop to the applet works fine with Safari 5.0.5 and FireFox 3.6 but not FireFox 4.0.1 running on OS X 10.6.7 with Java SE 6 1.6.0_24-b07-334.
Version: unspecified → 4.0 Branch
I can confirm this as well.  Interestingly drag-and-drop works if you hold command over the java applet and grab the java applet frame and drag the java applet into its own window.
Drag and drop also doesn't work if you have an applet that uses drag and drop internally (drag from one area of the applet to another -- instead of dragging something outside the applet into the applet).

There doesn't seem to be a workaround for this issue.  It is causing a great deal of pain right now.
This bug was reported using a pre-release version of Firefox 4. Now that Firefox 4.0.1 final has been released, can you please update and retest your bug? A fresh profile would be a good starting place to test, 
http://support.mozilla.com/kb/Managing+profiles. If you continue to see the issue, can you please update this bug with your results?

Filter: firefox4prebugsunco
I'm on Firefox 4.0.1 on MacOS. I deleted my current profile as requested. The bug still exist.
A good place to test the bug is http://www.javaatwork.com/java-upload-applet/demo.html. This page opens a java applet with a drag and drop feature from the desktop. 
The result of java -version is:
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
I tested the window version of firefox - there the drag and drop from desktop is suported.
Thanks for listening to our requests.
Klaus
java version "1.6.0_24"

I have tried drag and drop in applet with both Firefox 4 and 5, and none of them support DnD on a Mac (10.6.8).
I'm on Firefox 5.0 Final on MacOS 10.6.7 with java version 1.6.0_24.
The drag and drop does still not work on MacOs, see JavaPowUpload for example: http://demo.element-it.com/Examples/JavaPowUpload/simpleupload.html

Windows 7 & XP has no problems with the drag and drop.

It's causing a lot of problems with our clients who are using mac and Firefox 4 / Firefox5.

I hope this bug will be fixed soon.

Thanks
Also curious to see if there is a fix to this. Though I don't think the problem is FF. 

I've noticed this issue myself just the past week after upgrading my OSX to Lion. I don't think the problem is necessarily with Lion either I think the problem more has to do with the upgraded version of Java that I'm now running and just hadn't updated on Snow Leopard in a while. This problem also seems to be specific to OSX as all tests on Windows still seem to be working.

Specifically I'm using the Aurigma uploader applet though I've tested this issue with several applet uploaders and had the same problems as of my Java upgrade. These uploaders used to all work on Safari, FF 3 / 4 and Chrome for me though no longer work.

In FF & Safari when I try dragging files (images) on to the drag & drop pane simply nothing happens now, the action is just ignored. In Chrome the uploader window just ends up getting completely replaced and displays whatever the first image I was trying to drag in as if I was just previewing an image through the browser.

I'm curious to know what versions of Java you guys all have to see if we that in common.

I'm running:

Java: 1.6.0_26-b03-383
http://cloud.conzone.com/2B2z0h0Y41302L1u1P1m

If you don't know how to grab the java version either
1) Use spotlight and search for: Java Preferences
or
2) Go to: /Applications/Utilities/Java Preferences

More of my machine / apps info

OSX 10.7

FF 5.0.1
Safari 5.1 (7534.48.3)
Chrome 13.0.782.107
I have found a workaround by simply copying the files and pasting into the drag and drop pane (Paste from clipboard)
I have found another "workaround" by opening a popup (JFrame) over the Applet.
This window can receive drag'n'drop events whereas the applet can not.
I tried to make it transparent and stuck to the applet position on screen, but there are other known bugs which prevent you to reliably get the applet position on screen, and to detect the dragging state of the mouse if you want to show/hide the JFrame dynamically ...
I dont think any of the mentioned workarounds are quite satisfactory.

Is there really no one that can pin point the root of this bug on mac os x? 

Drag n drop in applets still doesnt work on mac os x for more than 6 months now.

I have java version "1.6.0_26" on mac os c 10.6.8 and its just not working. 

Tested in Safari (5.1) and the image file dropped simply is displayed in the browser window instead. 
In Firefox 5.0.1 nothing happens at all.
ANd in Google Chrome (13.0.782.112) same thing as Safari. The browser simply displays the image dropped instead of dopping it on to the applet

No problems on windows. Should this perhaps be addressed directly to Apple or Oracle instead??

Would love to have someone with a little heavy weight know-how point out excactly what the problem boils down to so it can be fixed once and for all.

Pray pray....
On the same MacBook machine (OSX 10.6.7) with Java 1.6.0_26, it's not working on Firefox (5.0.1), but it's working perfectly on Safari (5.0.5 6533.21.1).
Well Safari 5.1 is newer and there it is not working again...
You are right, I just updated Safari to 5.1 and it stopped working :-(
Is there any update on this issue?
No news. It is well documented though. It is up to Apple to fix this. See my mail correspondence below with some applet programmers who rely on java plugin:

We’re aware of this problem with drag and drop on Mac. Actually the issue is experienced not only with Mozilla but even with Safari on version 10.7 (Lion). The problem is caused by Java plug-in coming with Mac OS; Apple is responsible for this Java. If you try to search for this problem in Google, you will find huge amount of complaints all over the world (e.g. https://discussions.apple.com/message/13296008?messageID=13296008%25EF%25BF%25BD#13296008?messageID=13296008%25EF%25BF%25BD).  We tried to contact Apple support – no luck, they don’t reveal when they are going to fix it. Also our engineers tried to work around the issue, but found nothing to do with it in Java code.
 
Best regards,
Dmitry Sevostyanov
Aurigma, Inc.  | CTO
----------------------------
Thank you for your attention on this bug.
Of course we know about this issue, but unfortunately there is no any
good solution for this problem. It's fully related to Apple's Java
implementation.

Here is answer of apple's developer (Mike Swingler) http://lists.apple.com/archives/java-dev/2011/Jul/msg00083.html

Quote from Mike's answer:
"Unfortunately this is a known issue with Plugin2, which has become the default applet plug-in for all browsers on Snow Leopard and Lion as of yesterday.
We have not found NPAPI to have sufficient facilities for us to replicate Java's external drag-and-drop services, and are looking for other technical avenues to pursue.
As a workaround, you can detach the applet from the web page by
holding down Cmd-Shift and dragging. The detached applet should respond correctly any DnD operations."

As alternate workaround you can set to true the value of the
Common.WindowMode parameter. In this case JavaPowUpload will be
started in JFrame (as standalone application) which can accept dnd operations.
---------------------------
I vote for a change of this bug status from UNCONFIRMED to CONFIRMED
(In reply to Aram de Glas from comment #25)
> I vote for a change of this bug status from UNCONFIRMED to CONFIRMED

me too
Me too!! This is a disgrace to Java. Sorry for strong words - but this has annoyed me for too long.

Isnt anything going to be done about this?
Hey, I also give my vote for this issue. and thank you guys for such an amazing work you are doing :)
The HTML <applet> element and related java functionality was removed from Gecko in Bug 1279218. Marking related bugs as invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: