如何允许将文本从写字板复制到我的 Java Swing 应用程序?
How to allow text to be copied from wordpad to my Java Swing app?
我想当然地认为,如果我的屏幕左侧有一个写字板,而我的 Java Swing 应用程序在屏幕右侧有一个 JTextfield,我可以使用 ctrl-C 复制文本从写字板然后按 ctrl-V 将文本放入 Java Swing 应用程序的 JTextfiled,但没有任何反应。
我最近更换了硬盘,并安装了Win7,Java ...所以我不确定这种行为是因为我重新安装了所有东西,还是像这样正常,我应该怎么做才能启用文本复制和粘贴?
经过一番研究,我找到了答案:
[1] Original app was compiled into a jar file, the jar file was doing copy-paste correctly either direction
[2] But the jar file can't be pined to the taskbar
[3] So I used exe4j to compile it into an exe file to be able to pin to the tackbar
[4] The result exe file can't do copy-paste correctly [ exe4j issue ]
[5] I found a way to pin jar file to the taskbar through a javaw.exe -jar *.jar shortcut,and pin that shortcut to the taskbar
我想当然地认为,如果我的屏幕左侧有一个写字板,而我的 Java Swing 应用程序在屏幕右侧有一个 JTextfield,我可以使用 ctrl-C 复制文本从写字板然后按 ctrl-V 将文本放入 Java Swing 应用程序的 JTextfiled,但没有任何反应。
我最近更换了硬盘,并安装了Win7,Java ...所以我不确定这种行为是因为我重新安装了所有东西,还是像这样正常,我应该怎么做才能启用文本复制和粘贴?
经过一番研究,我找到了答案:
[1] Original app was compiled into a jar file, the jar file was doing copy-paste correctly either direction
[2] But the jar file can't be pined to the taskbar
[3] So I used exe4j to compile it into an exe file to be able to pin to the tackbar
[4] The result exe file can't do copy-paste correctly [ exe4j issue ]
[5] I found a way to pin jar file to the taskbar through a javaw.exe -jar *.jar shortcut,and pin that shortcut to the taskbar