JDK-4032728 : cannot consume gain focus events
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95
  • CPU: x86
  • Submitted: 1997-02-17
  • Updated: 1999-12-20
  • Resolved: 1999-12-20
Related Reports
Duplicate :  
Description

Name: mc57594			Date: 02/17/97


In many applications the programer wants to restrict focus
change until a certain circumstance is met.  For example
a given control might be "required".  The program should
then thwart all attempts by the user to leave that control
without actually entering some data.  This is very difficult
to program in JAVA.

The leaving focus event is called too frequently to be
of much use, and the reason for the call is unknown.  For
example a leaving focus event is generated when the user
clicks on another application.  the permanent/temporary
flag is insufficiently fine to detect the reason.

So one is forced to use the gaining focus event.  But it
is not possible to consume that event.  The best we can
do is request focus back on the original component.  This
causes two more events to fire, which our code must know
to skip.  

The code to implement this requirement is therefore a
complicated mess global data - to remember the component
from whence we came and to know to ingore certain events
when switching back.  Definitely not object-oriented!
company  -  Prolifics, a JYACC company  , email  -  ###@###.###
======================================================================

Comments
WORK AROUND Name: mc57594 Date: 02/17/97 ======================================================================
11-06-2004