如何从JavaFX应用程序中读取X11剪贴板? [英] How can I read the X11 clipboard from a JavaFX application?
问题描述
我正在研究JavaFX应用程序,我想支持在X11环境中通过鼠标中键粘贴文本。
I'm working on a JavaFX application and I would like to support pasting text via middle mouse button in an X11 environment.
有没有办法访问Java / JavaFX中X11剪贴板的内容?
Is there a way to access the content of the X11 clipboard in Java/JavaFX?
推荐答案
根据这个
https://bugs.openjdk.java.net/browse/JDK-8088117 无法访问Selection使用JavaFX。
According to this https://bugs.openjdk.java.net/browse/JDK-8088117 there is no way to access Selection with JavaFX.
错误报告
在SUSE11上使用JavaFX-8和Java8u45 ,无法使用鼠标选择或使用滚动上的单击进行复制/粘贴。详情请见: http://stackoverflow.com/questions/30032290/ javafx-mouse-clipboard-does-not-work-in-unix
回答
将优先级降低到P4。我注意到这是一个未实现的功能而不是一个bug(它从未在FX中得到支持)。我们将在JDK 9中查看它。
解决方法:使用复制/粘贴(CTRL-C / CTRL-V)
Lowering the priority to P4. I note that this is more of an unimplemented feature than a bug (it has never been supported in FX). We will look at it for JDK 9. Workaround: use copy/paste (CTRL-C / CTRL-V)
这篇关于如何从JavaFX应用程序中读取X11剪贴板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!