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

1.3: Using asynchronousLoadPriority(-1), objects in JTextPane overlap (1.1.x OK)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0
    • client-libs



      Name: krC82822 Date: 11/21/2000


      orig synopsis: "HTMLDocuments with asynchronousLoadPriority -1 & ObjectViews are incorr'ly shown"

      21 Nov 2000, eval1127@eng -- reproducible with both 1.3.0 (Linux/Solaris/NT4.0)
      and 1.2.2 (on NT 4.0 only): The buttons (docs) overlap, till enclosing frame is resized.
      1.1.8 with Swing 1.1.1 works fine, as does 1.2.2 on Solaris (Linux not tested).

      Tried various workarounds without success.
      ---------------------
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0beta_refresh-b09)
      Java HotSpot(TM) Client VM (build 1.3.0beta-b07, mixed mode)

      also appearing in

      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
      Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20000623 (JIT enabled:
      jitc))


      Compile Code
      -----------------------------------------------------------------
      import javax.swing.*;
      import javax.swing.text.*;
      import javax.swing.text.html.*;

      /**
       * Simple class to show problems with synchronous loading under JDK 1.3.
       * The JButtons loaded via <object> tag are laying one over the other.
       * @author vincenz
       * @version $Revision: 1.2 $
       */
      public class HTMLViewerTest extends Object {


          public static void main(String[] args) {
              final JTextPane pane = new JTextPane();
              pane.setContentType("text/html");
              pane.setEditable(false);
              pane.setEditorKit(new EditorKit());
              final JFrame frame = new JFrame();
              final JTabbedPane tabpane = new JTabbedPane();
              tabpane.setTabPlacement(JTabbedPane.BOTTOM);
              frame.setContentPane(tabpane);
              frame.setSize(600, 400);
              frame.show();


              SwingUtilities.invokeLater(new Runnable() {

                  public void run() {
                      try {
                          tabpane.addTab("Hallo", pane);
                          pane.setPage("file:/home/vincenz/main_menu.html");
                      } catch (Exception e) {
                          e.printStackTrace();
                      }
                  }
              });
          }

          static protected class EditorKit extends HTMLEditorKit {

              public Document createDefaultDocument() {
                  HTMLDocument doc = (HTMLDocument) super.createDefaultDocument();
                  doc.setAsynchronousLoadPriority(-1);
                  return doc;
              }
          }
      }
      -------------------------------------------------------------------

      and use this html page

      -------------------------------------------------------------------
      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
      <html>
        <head>
          <title>Auswahl</title>
        </head>

        <body>
          <table>
            <tr>
      <td>
      <object classid="javax.swing.JButton">
      <param name="text" value="Document Download">
      </object>
      </td>
      <td>
      <object classid="javax.swing.JButton">
      <param name="text" value="Document Download">
      </object>
      </td>
            </tr>
            <tr>
      <td>
      <object classid="javax.swing.JButton">
      <param name="text" value="Document Download">
      </object>
      </td>
      <td>
      <object classid="javax.swing.JButton">
      <param name="text" value="Document Download">
      </object>
      </td>
            </tr>
            <tr>
      <td>
      <object classid="javax.swing.JButton">
      <param name="text" value="Document Download">
      </object>
      </td>
      <td>
      <object classid="javax.swing.JButton">
      <param name="text" value="Document Download">
      </object>
      </td>
            </tr>
            <tr>
      <td>
      <object classid="javax.swing.JButton">
      <param name="text" value="Document Download">
      </object>
      </td>
      <td>
      <object classid="javax.swing.JButton">
      <param name="text" value="Document Download">
      </object>
      </td>
            </tr>
          </table>
        </body>
      </html>


      REMARKS:

      Under JDK1.1.X(with last final Swing Release) and JDK1.2.2 there is no such
      Problem. [note: user's claim that 1.2.2 is OK was not supported by our tests.]
      (Review ID: 108035)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: