You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Denis Kishenko (JIRA)" <ji...@apache.org> on 2006/11/01 10:21:57 UTC

[jira] Created: (HARMONY-2030) [classlib][awt] JComponent doesn't send 'removed' event

[classlib][awt] JComponent doesn't send 'removed' event
-------------------------------------------------------

                 Key: HARMONY-2030
                 URL: http://issues.apache.org/jira/browse/HARMONY-2030
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Denis Kishenko


When JComponent becomes invisible, it doesn't send 'removed' event to its ancestorListeners 

========== Test ==========
import javax.swing.*;
import javax.swing.event.*;

public class Test {

   public static void main(String[] string) throws Exception {
            AncestorListenerImpl al = new AncestorListenerImpl();

            JWindow window = new JWindow();
            JComponent jc = new JComponent() {
            };

            window.getContentPane().add(jc);
            window.setVisible(true);

            jc.setVisible(true);
            jc.addAncestorListener(al);

            jc.setVisible(false);

            Thread.sleep(1000);
            System.out.println("finish");
            System.exit(0);
   }
}


class AncestorListenerImpl implements AncestorListener {
    public void ancestorAdded(AncestorEvent arg0) {
        System.err.println("added");
    }

    public void ancestorMoved(AncestorEvent arg0) {
       System.err.println("moved");
    }

    public void ancestorRemoved(AncestorEvent arg0) {
        System.err.println("removed");
    }
}

======== RI ===========
removed
finish

=========== Harmony ========
java.lang.RuntimeException: Not owner can't unlock resource.
	at org.apache.harmony.awt.wtk.Synchronizer.unlock(Synchronizer.java:115)
	at java.awt.Toolkit.unlockAWT(Toolkit.java:391)
	at java.awt.Component.show(Component.java:3095)
	at java.awt.Component.show(Component.java:3102)
	at java.awt.Component.setVisible(Component.java:3075)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira