-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
5.0
-
x86
-
linux
FULL PRODUCT VERSION :
1.4.2-b28
ADDITIONAL OS VERSION INFORMATION :
linux 2.4.21-99
A DESCRIPTION OF THE PROBLEM :
Anything copied from an HTML JEditorPane puts extra C/R on clipboard at the beginning and the end of the text copied.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the test case. With the plain text version copy and paste work correctly, With the html version the copy puts extra C/R
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect the HTML version to work like the plain text version
ACTUAL -
The HTML version is broken
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.JEditorPane;
import javax.swing.JFrame;
public class htmlcopytest
{
public static void main(String[] args)
{
JEditorPane editorPane = new JEditorPane("text/plain", "Now is the time for all good men to come to the aid of their party");
// JEditorPane editorPane = new JEditorPane("text/html", "<html><body>Now is the time for all good men to come to the aid of their party</body></html>");
JFrame frame = new JFrame();
frame.getContentPane().add(editorPane);
frame.setSize(300, 300);
frame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Create your on TransferHandler
###@###.### 2005-1-13 02:47:38 GMT
1.4.2-b28
ADDITIONAL OS VERSION INFORMATION :
linux 2.4.21-99
A DESCRIPTION OF THE PROBLEM :
Anything copied from an HTML JEditorPane puts extra C/R on clipboard at the beginning and the end of the text copied.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the test case. With the plain text version copy and paste work correctly, With the html version the copy puts extra C/R
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect the HTML version to work like the plain text version
ACTUAL -
The HTML version is broken
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.JEditorPane;
import javax.swing.JFrame;
public class htmlcopytest
{
public static void main(String[] args)
{
JEditorPane editorPane = new JEditorPane("text/plain", "Now is the time for all good men to come to the aid of their party");
// JEditorPane editorPane = new JEditorPane("text/html", "<html><body>Now is the time for all good men to come to the aid of their party</body></html>");
JFrame frame = new JFrame();
frame.getContentPane().add(editorPane);
frame.setSize(300, 300);
frame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Create your on TransferHandler
###@###.### 2005-1-13 02:47:38 GMT
- duplicates
-
JDK-4746835 REGRESSION: In SDK1.4.1, pasting into JEditorPane creates a new paragraph
- Closed
- relates to
-
JDK-6277938 REGRESSION: HTMLDocument: sometimes 'content' elements are inserted directly into the 'body' element
- Resolved