Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将带有颜色的文本复制到剪贴板_Java_Windows_Swing_Clipboard - Fatal编程技术网

Java 将带有颜色的文本复制到剪贴板

Java 将带有颜色的文本复制到剪贴板,java,windows,swing,clipboard,Java,Windows,Swing,Clipboard,正如标题所说,如何将彩色/样式文本复制到Java中的windows剪贴板 文本位于窗格中,如下所示: JEditorPane je = new JEditorPane("text/html","a <font color=\"yellow\">banana</font>"); JEditorPane je=新的JEditorPane(“文本/html”,“香蕉”); 选择文本并按ctrl+c后,我想在word中复制并粘贴文本,但样式仍处于活动状态。无法将其复制为纯文本

正如标题所说,如何将彩色/样式文本复制到Java中的windows剪贴板

文本位于
窗格中,如下所示:

JEditorPane je = new JEditorPane("text/html","a <font color=\"yellow\">banana</font>");
JEditorPane je=新的JEditorPane(“文本/html”,“香蕉”);

选择文本并按ctrl+c后,我想在word中复制并粘贴文本,但样式仍处于活动状态。

无法将其复制为纯文本。您需要使用CF_HTML或富文本格式。

从何处到何处?它是什么颜色的?我已经编辑了我的问题:)