在Java 6u13 +中从Java WebStart(JNLP)启动浏览器窗口 [英] Launching a browser window from Java WebStart (JNLP) in Java 6u13+

查看:214
本文介绍了在Java 6u13 +中从Java WebStart(JNLP)启动浏览器窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java 6u13和6u14中存在一个错误。
http://bugs.sun.com/view_bug.do?bug_id= 6835450

There is a bug in Java 6u13 and 6u14. http://bugs.sun.com/view_bug.do?bug_id=6835450

简单地说,以下代码应该打开浏览器窗口,但由于框架中的错误,它在Java 1.6更新中停止工作13.再也没有打开了。 Java applet存在类似的错误(在更新14中已得到修复),但这一错误仍存在于Java WebStart / JNLP的更新14中。

Simply put, the following code is supposed to open a browser window, but because of a bug in the framework, it stopped working in Java 1.6 update 13. Nothing opens anymore. There was a similar bug for Java applets (that was fixed in update 14), but this one still exists in update 14 for Java WebStart/JNLP.

getAppletContext().showDocument(new URL("http://www.sun.com"),"_blank");

您知道有任何变通方法吗?

Do you know of any workarounds?

推荐答案

我没有在JNLP中尝试过,但通常这应该可行:

I've not tried it in JNLP, but normally this should work:

java.awt.Desktop.getDesktop().browse(new URI("http://www.sun.com"));

这篇关于在Java 6u13 +中从Java WebStart(JNLP)启动浏览器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆