-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: 6u12
-
Component/s: client-libs
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)
1.6.0_12-b04
1.7.0-ea-b44
ADDITIONAL OS VERSION INFORMATION :
5.1.2600
A DESCRIPTION OF THE PROBLEM :
When running supplied example, pasting text from MS Word 2007 or MS WordPad the text will always be inserted after current text disregarding caret position. When pasting non formatted text from MS Notepad the text will be inserted at caret position which is expected behavior.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile and run supplied code
2. Manually write some text into the JTextPane
3. Copy some formatted text from an RTF editor
4. Move caret position in the JTextPane to the beginning of the text
5. Paste the formatted text from the clipboard
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The text will be inserted after existing text.
ACTUAL -
The text will be inserted after existing text.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.text.rtf.*;
public class JTextPaneTest {
public JTextPaneTest() {}
public static void main(String[] args) {
JFrame frm = new JFrame();
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTextPane textpane = new JTextPane();
RTFEditorKit kit = (RTFEditorKit)textpane.getEditorKitForContentType("text/rtf");
DefaultStyledDocument doc = (DefaultStyledDocument)kit.createDefaultDocument();
textpane.setEditorKit(kit);
textpane.setDocument(doc);
frm.add(textpane);
frm.setVisible(true);
}
}
---------- END SOURCE ----------
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)
1.6.0_12-b04
1.7.0-ea-b44
ADDITIONAL OS VERSION INFORMATION :
5.1.2600
A DESCRIPTION OF THE PROBLEM :
When running supplied example, pasting text from MS Word 2007 or MS WordPad the text will always be inserted after current text disregarding caret position. When pasting non formatted text from MS Notepad the text will be inserted at caret position which is expected behavior.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile and run supplied code
2. Manually write some text into the JTextPane
3. Copy some formatted text from an RTF editor
4. Move caret position in the JTextPane to the beginning of the text
5. Paste the formatted text from the clipboard
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The text will be inserted after existing text.
ACTUAL -
The text will be inserted after existing text.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.text.rtf.*;
public class JTextPaneTest {
public JTextPaneTest() {}
public static void main(String[] args) {
JFrame frm = new JFrame();
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTextPane textpane = new JTextPane();
RTFEditorKit kit = (RTFEditorKit)textpane.getEditorKitForContentType("text/rtf");
DefaultStyledDocument doc = (DefaultStyledDocument)kit.createDefaultDocument();
textpane.setEditorKit(kit);
textpane.setDocument(doc);
frm.add(textpane);
frm.setVisible(true);
}
}
---------- END SOURCE ----------