简体   繁体   English

TornadoFX:允许将项目从列表视图复制到剪贴板

[英]TornadoFX: Allow copying an item from a listview to clipboard

When an item in a listview is selected, I would like the user to be able to copy the content to the clipboard. 当选择列表视图中的项目时,我希望用户能够将内容复制到剪贴板。 How can I achieve that? 我该如何实现?

You could add a shortcut to the view like so 您可以像这样向视图添加快捷方式

shortcut(KeyCombination.valueOf("Ctrl+C")) {
    // Convert the selected item as you see fit and add it to the clipboard
    // For example:
    clipboard.put(MyCustomFormat, listview.selectedItem)
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM