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)
======================================================================