Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正如标题所说,如何将彩色/样式文本复制到 Java 中的 Windows 剪贴板?
文本位于JEditorPane这样的位置:
JEditorPane
JEditorPane je = new JEditorPane("text/html","a <font color=\"yellow\">banana</font>");
选择文本并按ctrl+c后,我想将文本复制并粘贴到 word 中,并且样式仍处于活动状态。
它不能复制为纯文本。您需要使用 CF_HTML 或富文本格式。