United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4470200 : Problem focus cell in table with rowspan

Details
Type:
Bug
Submit Date:
2001-06-14
Status:
Resolved
Updated Date:
2002-11-16
Project Name:
JDK
Resolved Date:
2002-11-16
Component:
client-libs
OS:
windows_nt
Sub-Component:
javax.swing
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.3.0
Fixed Versions:
1.4.2 (mantis)

Related Reports

Sub Tasks

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
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
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis

FIXED IN:
mantis

INTEGRATED IN:
mantis
mantis-b08


                                     
2004-06-14



Hardware and Software, Engineered to Work Together