java Clipboard error (bug)?

*爱你&永不变心* 提交于 2019-12-04 18:18:16
Dreamspace President

Assuming that your copy() method sets the clipboard text, I am having the exact same problem and have found a weird workaround.

Java clipboard ignores user copy if not SwingUtilities.invokeLater()

I can get the clipboard text, which will always show whatever the user has copied there at any time. But if I set the clipboard text programmatically, afterwards that's all I get from the clipboard - except if I postpone further clipboard text getting via SwingUtilities.invokeLater() one time, then the clipboard text getting works fine again. I can then also break it again - and "fix" it again.

I have no idea why this is so, hence the question I just posted (see link).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!