public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug AWT/16762] New: Cannot dispatch MouseEvents to components that have just been removed.
@ 2004-07-27  0:39 gcc-bugzilla at gcc dot gnu dot org
  2004-07-27  1:05 ` [Bug AWT/16762] " fitzsim at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-07-27  0:39 UTC (permalink / raw)
  To: gcc-bugs

>From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

Description of problem:
I have the following piece of code:

    final JFrame f = new JFrame();
    final JButton a = new JButton("button");

    a.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        f.remove(a);
      }
    });

    f.getContentPane().add(a);
    f.pack();
    f.show();


When you click on the button that shows up, it whines about NPEs when
acquiring a target for the mouse events. In Sun's, it does remove the
button (but does not update the frame until you do something to it).

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
Run the sample code.

Actual Results:  Exception thrown is:

Exception during event dispatch:
java.lang.NullPointerException
   at java.awt.Component.getLocationOnScreen()
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-java-awt.so.0.0.0)
   at
javax.swing.SwingUtilities.convertPointFromScreen(java.awt.Point,
java.awt.Component)
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-javax-swing.so.0.0.0)
   at javax.swing.SwingUtilities.convertPoint(java.awt.Component, int,
int, java.awt.Component)
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-javax-swing.so.0.0.0)
   at
java.awt.LightweightDispatcher.acquireComponentForMouseEvent(java.awt.event.MouseEvent)
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-java-awt.so.0.0.0)
   at java.awt.LightweightDispatcher.handleEvent(java.awt.AWTEvent)
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-java-awt.so.0.0.0)
   at java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-java-awt.so.0.0.0)
   at java.awt.Window.dispatchEventImpl(java.awt.AWTEvent)
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-java-awt.so.0.0.0)
   at java.awt.Component.dispatchEvent(java.awt.AWTEvent)
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-java-awt.so.0.0.0)
   at java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-java-awt.so.0.0.0)
   at java.awt.EventDispatchThread.run()
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/lib-java-awt.so.0.0.0)
   at _Jv_ThreadRun(java.lang.Thread)
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/libgcj.so.6.0.0)
   at GC_start_routine
(/home/kho/gcj-inst/i686-pc-linux-gnu/libjava/.libs/libgcj.so.6.0.0)
   at __clone (/lib/tls/libc-2.3.3.so)

Expected Results:  The button is removed from the frame.

Additional info:
------- Additional Comments From djee at redhat dot com  2004-05-31 10:26 -------
The problem was in Container.remove().  A removed component should be
set to invisible after it is removed, but this was not being done. 
The Component.getLocationOnScreen() method was getting tripped up over
this inconsistency.

The fix is now in the java-gui-branch.  Please verify with the test
case mentioned in the original bug report.
------- Additional Comments From kho at redhat dot com  2004-05-31 15:14 -------
verified.

-- 
           Summary: Cannot dispatch MouseEvents to components that have just
                    been removed.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P1
         Component: AWT
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kho at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org,kho at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16762


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug AWT/16762] Cannot dispatch MouseEvents to components that have just been removed.
  2004-07-27  0:39 [Bug AWT/16762] New: Cannot dispatch MouseEvents to components that have just been removed gcc-bugzilla at gcc dot gnu dot org
@ 2004-07-27  1:05 ` fitzsim at redhat dot com
  2004-07-27  2:01 ` fitzsim at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: fitzsim at redhat dot com @ 2004-07-27  1:05 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal
           Priority|P1                          |P2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16762


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug AWT/16762] Cannot dispatch MouseEvents to components that have just been removed.
  2004-07-27  0:39 [Bug AWT/16762] New: Cannot dispatch MouseEvents to components that have just been removed gcc-bugzilla at gcc dot gnu dot org
  2004-07-27  1:05 ` [Bug AWT/16762] " fitzsim at redhat dot com
@ 2004-07-27  2:01 ` fitzsim at redhat dot com
  2004-07-27  2:18 ` fitzsim at redhat dot com
  2004-07-30 19:47 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: fitzsim at redhat dot com @ 2004-07-27  2:01 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |djee at redhat dot com
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-27 02:01:04
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16762


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug AWT/16762] Cannot dispatch MouseEvents to components that have just been removed.
  2004-07-27  0:39 [Bug AWT/16762] New: Cannot dispatch MouseEvents to components that have just been removed gcc-bugzilla at gcc dot gnu dot org
  2004-07-27  1:05 ` [Bug AWT/16762] " fitzsim at redhat dot com
  2004-07-27  2:01 ` fitzsim at redhat dot com
@ 2004-07-27  2:18 ` fitzsim at redhat dot com
  2004-07-30 19:47 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: fitzsim at redhat dot com @ 2004-07-27  2:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fitzsim at redhat dot com  2004-07-27 02:01 -------
Verified fixed on java-gui-branch.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16762


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug AWT/16762] Cannot dispatch MouseEvents to components that have just been removed.
  2004-07-27  0:39 [Bug AWT/16762] New: Cannot dispatch MouseEvents to components that have just been removed gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-07-27  2:18 ` fitzsim at redhat dot com
@ 2004-07-30 19:47 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-30 19:47 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16762


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-30 19:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-27  0:39 [Bug AWT/16762] New: Cannot dispatch MouseEvents to components that have just been removed gcc-bugzilla at gcc dot gnu dot org
2004-07-27  1:05 ` [Bug AWT/16762] " fitzsim at redhat dot com
2004-07-27  2:01 ` fitzsim at redhat dot com
2004-07-27  2:18 ` fitzsim at redhat dot com
2004-07-30 19:47 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).