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

Extra PropertyChange notification when vetoing a focus change event

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 1.4.0
    • client-libs
    • None
    • b08
    • x86
    • windows_nt
    • Verified

      I have a test application (attached as FocusChangeTest.java) that has two JTextFields. I've added a VetoableChangeListener to the KeyboardFocusManager to veto any focus change that would put focus on the second JTextField. It also prints out the old and new values in the PropertyChangeEvent.

      Upon launching the application, the following is printed to the console, as the first text field gains focus:

      0 Old=null, New=One

      After hitting TAB, the following is printed out.

      1 Old=One, New=null
      2 Old=null, New=Two
      VETOING
      3 Old=Two, New=null
      4 Old=null, New=null
      5 Old=null, New=One

      Line is quite odd and doesn't really make sense. Seems like a bug to me.

            ant Anton Tarasov (Inactive)
            shickeysunw Shannon Hickey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: