Index: java/awt/Component.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v retrieving revision 1.90 diff -u -r1.90 Component.java --- java/awt/Component.java 30 Nov 2005 18:03:07 -0000 1.90 +++ java/awt/Component.java 30 Nov 2005 19:16:04 -0000 @@ -3019,11 +3019,6 @@ if (focusListener == null) return; - // Don't dispatch FOCUS_GAINED or FOCUS_LOST events if the opposite - // Component is the same as the receiving Component. - if (e.getOppositeComponent() == this) - return; - switch (e.id) { case FocusEvent.FOCUS_GAINED: @@ -4796,7 +4791,12 @@ void dispatchEventImpl(AWTEvent e) { Event oldEvent = translateEvent (e); - + // This boolean tells us not to process focus events when the focus + // opposite component is the same as the focus component. + boolean ignoreFocus = + (e instanceof FocusEvent && + ((FocusEvent)e).getComponent() == ((FocusEvent)e).getOppositeComponent()); + if (oldEvent != null) postEvent (oldEvent); @@ -4827,7 +4827,8 @@ break; } } - if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE) + if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE + && !ignoreFocus) processEvent(e); }