Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
在deepin环境下使用java操作剪切板
社区开发
605
views ·
0
replies ·
To
floor
Go
xuming9
deepin
2019-03-12 05:39
Author
我使用java在deepin环境下操作剪切板,在程序运行时,读写剪切板都很正常,但退出程序后,剪切板就还原了,代码如下
/**
* 将字符串复制到剪切板。
*/
public static void writeTextToClipper(String txt) {
Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable tText = new StringSelection(txt);
clip.setContents(tText, null);
}
Copy the Code
deepin是否有N个剪切板,程序运行时是否会分配1个临时剪切板?
有大神碰到过这个情况么?
tip:windows无这个问题
Reply
Like 0
Favorite
View the author
All Replies
No replies yet
Please
sign
in first
Featured Collection
Change
Nuntia - Modern IMAP/SMTP mail client for Deepin (Beta tester wanted!)
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
Taskbar no longer shows popups
Four agent skills for laptop power, sleep, and honest bug reports
Popular Events
More
deepin是否有N个剪切板,程序运行时是否会分配1个临时剪切板?
有大神碰到过这个情况么?
tip:windows无这个问题