JEditorPaneAccessibleHypertextSupport.HTMLLink methods dont work in applet

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: aaC67449 Date: 10/06/98



      JEditorPaneAccessibleHypertextSupport.HTMLLink methods work incorrectly when used in applet.
      See example. It gets HTMLLink class and then prints values returned by various methods

      The results from aplication and from applet are different

      ----------------- Example ----------------

      ---------Test.java------
      import javax.swing.*;
      import javax.accessibility.*;

      public class Test extends JApplet{

         public static void main(String argv[]) {
           (new Test()).init();
         }
         
         public void init() {
           String test="<!DOCTYPE HTML PUBLIC \"-//w3c//DTD html 3.2//EN\"><HTML><HEAD><TITLE>test</TITLE></HEAD></head><body><P><A Href=\"index.html\">Test1</A></P></body></html>";
       
          JEditorPane o = new JEditorPane("text/html",test);
          AccessibleHyperlink c=(AccessibleHyperlink)((AccessibleHypertext)o.getAccessibleContext().getAccessibleText()).getLink(0);

          System.out.println("getStartIndex="+c.getStartIndex());
          System.out.println("getEndIndex="+c.getEndIndex());
          System.out.println("getAccessibleActionDescription="+c.getAccessibleActionDescription(0));
          System.out.println("getAccessibleActionAnchor="+c.getAccessibleActionAnchor(0));
          


        }

      }
      ------------- test1.html --------
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.X//EN">
      <html>
        <head>
          <title>Test</title>
        </head>
       
        <body>
            <p> <hr>
            <applet
              code=Test
              codebase="classes"
            >
            </applet>
       
        </body>
      </html>


      --------------- Applet output ------------------
      #>appletviewer http://server:8080/~ali/test1.html
      getStartIndex=5
      getEndIndex=6
      getAccessibleActionDescription=
      getAccessibleActionAnchor=

      ---------------- Application output-------
      #>java Test
      getStartIndex=5
      getEndIndex=10
      getAccessibleActionDescription=Test1
      getAccessibleActionAnchor=Test1

      ======================================================================

            Assignee:
            Tim Prinzing (Inactive)
            Reporter:
            Artem Aliev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: