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

SwingEventMonitor misses all DocumentEvents, when a new Document is set.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • client-libs
    • beta
    • generic
    • generic
    • Not verified



      Name: mc57594 Date: 12/16/99


      java version "1.2.2"
      HotSpot VM (1.0.1, mixed mode, build g)



      This bug is in the class SwingEventMonitor of the Accessibility Utilities 1.2.2
      as well as in Accessibility Utilities 1.3 beta.

      SwingEventMonitor should catch all events fired on all swing components.
      DocumentEvents are missed, when the a new Document is set on a TextComponent.

      This bug can be reproduced by changing the Notepad demo
      (jdk1.2.2\demo\jfc\Notepad).
      1)
      Add the following statement as the last line to the main method:
              
      com.sun.java.accessibility.util.SwingEventMonitor.addDocumentListener(new
      DocumentListener(){
               public void changedUpdate(DocumentEvent e){
               System.out.println("Text changed");
               }
               public void insertUpdate(DocumentEvent e){
               System.out.println("Text inserted");
               }
               public void removeUpdate(DocumentEvent e){
               System.out.println("Text removed");
               }
              });
      3)
      Add the Accessibility Utilities Jar file 'jaccess.jar' to the classpath (or put
      it in lib/ext)
      2)
      Now run Notepad.
      3)
      Enter some text. The events are printed properly on the console.
      4)
      Press the first button on the toolbar (New).
      5)
      Enter some text. The events are no longer recognized.
      (Review ID: 98921)
      ======================================================================

            lmonsantsunw Lynn Monsanto (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: