Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4143900

Dont know where focus is going to when received lostFocus(FocusEvent e)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.5
    • client-libs
    • x86
    • windows_nt



      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)
      ======================================================================

            dmendenhsunw David Mendenhall (Inactive)
            moanceasunw Mircea Oancea (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: