JDK-4143900 : Dont know where focus is going to when received lostFocus(FocusEvent e)
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.5
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-05-29
  • Updated: 2000-10-04
  • Resolved: 2000-10-04
Related Reports
Duplicate :  
Duplicate :  
Description

Name: moC74494			Date: 05/29/98


This is the second time I have submitted this
problem, I received no response after the first.

One must be able to determine where focus is going
if a control loses focus.  Suppose you have 3
components that make up a GUI widget.  I want
special behavior if the user traverses (either
with a mouse or keyboard) between the 3 components.
BUT, if they go to a control other than the three
that makes up the widget, I want to do some sort
of data validation checking.

If I add a focus listener to all three controls
when focus goes from control 'A' to control 'B',
I get a focusLost first in 'A' and then a 
focusGained in 'B'. I have not idea in 'A's 
focusLost where the focus is going. 

Since the windows events support this knowing what
control is getting the focus, AWT FocusEvent should
also provide this.

I suggest that FocusEvent has two methods: 
public Component getPrevious();
public Component getNext();

Then one could do the following:

public void focusLost(FocusEvent e)
{
   Component nextC = e.getNext();
   if ( (nextC != compA) && (nextC != compB) && (nextC != compC) )
   {
      validateDataInControls();
   }
}

PLEASE let me know what you will be doing regarding
this matter.  If this is an enhancement, then I 
would like to know when I will see a change.  If you
are not going to support this, then I have to start
work on making some sort of native piece.  (So much
for 100% Pure Java!)

Thanks,
--Ken
(Review ID: 29634)
======================================================================

Comments
EVALUATION Currently planning to implement this functionality, or equivalent functionality, in the merlin focus enhancements. david.mendenhall@eng 1999-12-14
14-12-1999