JDK-4470200 : Problem focus cell in table with rowspan
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-06-14
  • Updated: 2002-11-16
  • Resolved: 2002-11-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2 mantisFixed
Description

Name: yyT116575			Date: 06/14/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)


When having a editable JEditorPane for HTML and html code showing one table
with two rows and two columns, and the second column of the first row is
rowspanning. The problem is that i can not focus text with the mouse in the
cell that is rowspanning. See example, try to mark the text "unavailable" with
the mouse. You see that the editorpane, at release, places the cursor at cell3.

--src
public class TableEditor extends javax.swing.JFrame {
  private String htmlCode = "<html><body><table border=\"1\"><tr><td><p>cell1</p>"
      +"</td><td rowspan=\"2\"><p>cell 2 unavailable</p></td></tr><tr><td><p>cell3</p>"
      +"</td></tr></table></body></html>";
    /** Creates new form TableEditor */
  public TableEditor() {
    initComponents ();
    jEditorPane1.setContentType ("text/html");
    jEditorPane1.setText (htmlCode);
    jEditorPane1.setEditable(true);
    setSize (640,480);
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the FormEditor.
   */
  private void initComponents() {
    jScrollPane1 = new javax.swing.JScrollPane();
    jEditorPane1 = new javax.swing.JEditorPane();
    addWindowListener(new java.awt.event.WindowAdapter() {
      public void windowClosing(java.awt.event.WindowEvent evt) {
        exitForm(evt);
      }
    });

    jScrollPane1.setViewportView(jEditorPane1);
          
    getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
        
  }

  /** Exit the Application */
  private void exitForm(java.awt.event.WindowEvent evt) {
    System.exit (0);
  }

  /**
   * @param args the command line arguments
   */
  public static void main (String args[]) {
    new TableEditor ().show ();
  }

  // Variables declaration - do not modify
  private javax.swing.JScrollPane jScrollPane1;
  private javax.swing.JEditorPane jEditorPane1;
  // End of variables declaration

}
(Review ID: 126629) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b08
2004-06-14

EVALUATION Name: dsR10138 Date: 07/15/2002 BoxView doen't not represent well enough rows/cols which have cells with row/colspan attribute. When a cell occupies several rows/cols BoxView.getViewAtPoint(int x, int y, Rectangle alloc) fails to find the correct view. The idea of a fix is to override Box.getViewAtPoint method in TableView class so that the correct views are returned in case of cells which occupy several rows/cols. ###@###.### 2002-07-15 ======================================================================
2002-07-15