3019 |
if (focusListener == null) |
if (focusListener == null) |
3020 |
return; |
return; |
3021 |
|
|
|
// 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; |
|
|
|
|
3022 |
switch (e.id) |
switch (e.id) |
3023 |
{ |
{ |
3024 |
case FocusEvent.FOCUS_GAINED: |
case FocusEvent.FOCUS_GAINED: |
4791 |
void dispatchEventImpl(AWTEvent e) |
void dispatchEventImpl(AWTEvent e) |
4792 |
{ |
{ |
4793 |
Event oldEvent = translateEvent (e); |
Event oldEvent = translateEvent (e); |
4794 |
|
// This boolean tells us not to process focus events when the focus |
4795 |
|
// opposite component is the same as the focus component. |
4796 |
|
boolean ignoreFocus = |
4797 |
|
(e instanceof FocusEvent && |
4798 |
|
((FocusEvent)e).getComponent() == ((FocusEvent)e).getOppositeComponent()); |
4799 |
|
|
4800 |
if (oldEvent != null) |
if (oldEvent != null) |
4801 |
postEvent (oldEvent); |
postEvent (oldEvent); |
4802 |
|
|
4827 |
break; |
break; |
4828 |
} |
} |
4829 |
} |
} |
4830 |
if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE) |
if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE |
4831 |
|
&& !ignoreFocus) |
4832 |
processEvent(e); |
processEvent(e); |
4833 |
} |
} |
4834 |
|
|