-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
1.1.5
-
x86
-
windows_nt
Name: clC74495 Date: 06/05/98
There are many times that in focusLost
where one wants to know what component is going
to get the focus. Currently there is no way to
find where the focus is going to. (Likewise in
focusGained one may want to know where the focus
came from.) Both are possible when programming
windows.
For example, You may want TextField t1 to do
something special if it loses focus and the
focus is going to TextField t2, otherwise if
the Focus is going to go to TextField t3 then
do nothing. This is NOT a <TAB> thing. Suppose
the mouse is used to go from t1 to t3, the it
has nothing to do with what the tab order is.
When the user click from t1 to t3, t1 will receive
a focusLost then t3 will get a focusGained. It
might be possible to fix the problem if t3 were
to get a focusGained first then t1 gets the
focusLost, this way one could keep track on
their own. (A little bit of a hack)
Please let me know if I am overlooking something,
otherwise, this is a terrible oversight/bug.
So, IN BRIEF, my concern is that when a component
is losing focus, there is no way of knowing what
component will gain the focus next. This needs
to be part of the FocusEvent class so that when I
receive a focusLost for a component, I can query
the FocusEvent as to what Object is getting the
focus.
Attached is a trivial sample of what is missing.
Please look at the File MyCustomControl.java for
comments on what the problem is. This may
not seem very important but I assure you that it
is something that is done all the time when creating
custom controls under the Windows API.
Thanks for your help.
(Review ID: 28522)
======================================================================
- duplicates
-
JDK-4143900 Dont know where focus is going to when received lostFocus(FocusEvent e)
-
- Closed
-