JDK-6753665 : Applet.stop() not called when launching dragged applet from desktop
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-09-29
  • Updated: 2011-02-16
  • Resolved: 2009-01-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u12 b01Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_10-rc2"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc2-b32)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Service Pack 3 Japanese
Firefox 3.0.1


A DESCRIPTION OF THE PROBLEM :
When dragged applets launched from the desktop, Applet.stop() is not called.  Probably Applet.destroy() is not either.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Put NewJApplet.class into SwingApplet1.jar.
2. Place SwingApplet1.jar, NewJApplet.jnlp, and test.html on Glassfish V2 server with JnlpDownloadServlet enabled.
3. Open test.html from Firefox 3.
4. Drag the applet out of the browser.
5. Close test.html.
6. Accept the desktop integration.
7. Enable the debug logging on Java Control Panel.
8. Launch NewJApplet from the desktop.
9 Close it.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The debug log contains one entry for "start() called" and one for "stop() called".
ACTUAL -
The debug log contains only one entry for "start() called".

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
== NewJApplet.java

import javax.swing.JApplet;

public class NewJApplet extends JApplet
{
    @Override
    public void start ()
    {
        System.err.println ("start() called");
    }

    @Override
    public void stop ()
    {
        System.err.println ("stop() called");
    }
}

== NewJApplet.jnlp

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="6.0+" codebase="$$codebase" href="$$name">
  <information>
    <title>NewJApplet</title>
    <vendor>vx68k.org</vendor>
    <offline-allowed/>
    <shortcut>
      <desktop/>
    </shortcut>
  </information>
  <resources>
    <java version="1.5+"/>
    <jar href="SwingApplet1.jar" main="true"/>
  </resources>
  <applet-desc main-class="NewJApplet"
               name="applet" width="150" height="100">
  </applet-desc>
</jnlp>

== test.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title></title>
    </head>
    <body>
        <applet code="NewJApplet" width="150" height="100">
            <param name="jnlp_href" value="TestApplet.jnlp">
            <param name="draggable" value="true">
        </applet>
    </body>
</html>

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
None as far as I know.

Comments
EVALUATION The default dragged-out applet CloseListener does not perforce applet.stop() and applet.destroy() before dispose the applet frame. This need be fixed.
29-09-2008

WORK AROUND applet code can use setAppletCloseListener() to set up its own ActionListener to perform applet lifecycle methods as a temp. workaround.
29-09-2008