This is reproducible on Linux and Windows platforms with jdk7 b27 PIT build. Not reproducible with 6u10 b23.
processFocusEvent method of a component is not called when a FocusEvent is dispatched to event queue even after enableEvents is called for the component.
To reproduce:
Run the below test. If a message 'processing focus event' is not printed on console, but is reproduced.
import java.awt.*;
import java.awt.event.*;
public class TestButton extends Button {
public TestButton() {
enableEvents(AWTEvent.FOCUS_EVENT_MASK);
}
public void processFocusEvent(FocusEvent fe) {
System.out.println("processing focus event");
System.exit(0);
}
public static void main(String[] args) {
TestButton b = new TestButton();
EventQueue eventQ = new EventQueue();
FocusEvent focusEvent = new FocusEvent(b, FocusEvent.FOCUS_GAINED);
eventQ.postEvent(focusEvent);
}
}