-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
x86
-
windows_nt
Name: rm29839 Date: 02/11/98
In JEditorPane with Java 1.2beta2, when you select
a section of text, the highlight doesn't match
the position of the text being selected. The highlight
is always a little farther down the line than it
should be. The example works fine with JDK 1.1.5.
Example code:
import com.sun.java.swing.*;
import java.awt.event.*;
import java.io.*;
public class HTMLHighlightBug extends JPanel {
public static void main(String s[]) {
JFrame frame = new JFrame("HTML Highlight Bug");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
});
frame.setSize(200, 300);
JEditorPane pane = new JEditorPane();
pane.setContentType("text/html");
try {
pane.read(new StringReader("<html><body>Select a portion of text. Notice the selection highlight doesn't match the text being selected. The highlight is always a little farther than down the line they should be.</body></html>"),
null);
}
catch (IOException e) {
System.out.println("Exception = " + e);
}
frame.getContentPane().add("Center", pane);
frame.setVisible(true);
}
}
(Review ID: 24934)
======================================================================
- duplicates
-
JDK-4130434 The Measurement of Text
-
- Closed
-