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

HTML table border rendered incorrectly when table is expanding

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 6
    • client-libs

      FULL PRODUCT VERSION :
      build 1.6.0-b105

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      If an HTML table with a border and no width specified is rendered in a pane and the table width is expanding because data is being entered into a cell, the right hand border is rendered incorrectly in that it isn't rendered and disappears. Deleting text will cause the border to reappear, i.e. when the table width is shrinking.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the attached source.

      Place the cursor in the right most column. Start typing. The right hand border will disappear if the cursor was placed before the number in the cell or all of the border except for a small portion next to the row of the cell will disappear if the cursor was placed after the number.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected results would be that the border in the HTML table is rendered in whole as the width expands.
      ACTUAL -
      The right hand side of the border in the HTML table is not rendered when the table width is expanding.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      import javax.swing.*;
      import javax.swing.text.html.*;

      public class TableFrame {

      public static void main(String[] args) {
      JEditorPane pane = new JEditorPane();
      pane.setContentType("text/html");
      pane.setText("<html><head></head><body><table border=1><tr><td>1</td><td>2</td><td>3</td></tr>" +
      "<tr><td>4</td><td>5</td><td>6</td></tr></table></body></html>");
      System.err.println(pane.getText());
      pane.setEditable(true);
      JFrame frame = new JFrame("Table bug");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.getContentPane().add(pane);
      frame.pack();
      frame.setVisible(true);
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None found

            peterz Peter Zhelezniakov
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: