且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

重点关注JDK7和本机组件的问题

更新时间:2022-03-21 01:36:44

全部 - 我们刚刚经历过这个另一个浏览器组件(DjProject Native Swing)的问题。在Java 1.6下一切正常,但在Java-7下,我们开始看到奇怪的问题,你可以输入一个输入框,但如果你选择向后修复拼写错误,你不能在点击鼠标后输入。要恢复,您必须从输入字段中选择,然后返回以继续编辑。

All - We just experienced this problem with another browser component (DjProject Native Swing). Everything works fine under Java 1.6 but under Java-7 we started seeing weird problems where you can type into an input box but if you select backwards to fix a typo you could not type after making the mouse click. To recover you had to select out of the input field and then back in to continue your edit.

参见 http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG -Desktop / html / awt.html #gdcqp
特别是关于sythentic焦点和焦点代理的部分。

See http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-Desktop/html/awt.html#gdcqp Particularly the part here about sythentic focus and focus proxies.

无论如何要剪一个长篇故事简言之 - 在我们的例子中,我能够通过将鼠标监听器附加到JWebBrowser.getNativeComponent()来找到解决方法。然后在mousePressed上执行一个browser.requestFocus(),然后执行一个browser.getNativeComponent()。requestFocusInWindow();

Anyway to cut a long story short - in our case I was able to find a work-around by attaching a mouse listener to the JWebBrowser.getNativeComponent(). Then on mousePressed execute a browser.requestFocus() followed by a browser.getNativeComponent().requestFocusInWindow();

希望这可以帮助遇到此问题的其他任何人。

Hope this helps anyone else that comes across this.