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

JEditorPane.getEditorKit() should call kit.install()

XMLWordPrintable

    • Fix Understood
    • generic
    • generic



      Name: boT120536 Date: 01/19/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      JEditorPane.getEditorKit() does not call kit.install(this) if it creates a new
      EditorKit:
          public EditorKit getEditorKit() {
              if (kit == null) {
                  kit = createDefaultEditorKit();
              }
              return kit;
          }

      This means that an EditorKit can be associated with a JEditorPane without
      having install(JEditorPane) called - this is probably a bug according to the
      javadoc for javax.swing.text.EditorKit, which states "The kit will have it's
      setComponent method called to establish it's relationship with a JTextComponent"

      As there is no method "setComponent", I assume this refers to the "install"
      method. The ammended code would be:

          public EditorKit getEditorKit() {
              if (kit == null) {
                  kit = createDefaultEditorKit();
                  kit.install(this);
              }
              return kit;
          }
      (Review ID: 115456)
      ======================================================================

            peterz Peter Zhelezniakov
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: