bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug swing/25165] Swing components give up and reclaim focus improperly


From: abalkiss at redhat dot com
Subject: [Bug swing/25165] Swing components give up and reclaim focus improperly
Date: 30 Nov 2005 19:04:53 -0000


------- Comment #3 from abalkiss at redhat dot com  2005-11-30 19:04 -------
The improved test case shown below shows that this bug was fixed incorrectly. 
Since Component.processEvent and Component.processFocusEvent can be overridden
we must handle this problem BEFORE these methods are invoked, as the test case
below shows that they aren't called on the JDK (when you click on the button)
but they ARE currently called in our implementation.

***TEST CASE***
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;


public class Focus
{ 
  public static void main(String args[])
  {
    JButton b = new JButton()
      {
        protected void processFocusEvent(FocusEvent e)
        {
          System.out.println ("processFocusEventCalled");
          super.processFocusEvent(e);
        }
        protected void processEvent (AWTEvent e)
        {
          if (e instanceof FocusEvent)
            System.out.println ("processEvent called");
          super.processEvent(e);
        }
      };
    b.addFocusListener(new FocusListener()
      {
        public void focusGained(FocusEvent e)
        {
          System.out.println ("\n\ngained");
          Thread.dumpStack();
        }
        public void focusLost (FocusEvent e)
        {
          System.out.println ("\n\nlost");
          Thread.dumpStack();
        }
      });
    JFrame f = new JFrame();
    f.setSize(300,300);
    f.add(b);
    f.setVisible(true);
  }
}


-- 

abalkiss at redhat dot com changed:

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


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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]