Java Open URL Inside of a JFrame

大城市里の小女人 提交于 2019-12-13 03:33:30

问题


I was wondering if there is a way to open a URL inside of a JFrame or JDialog. I need this to protect the URL.

Is there a way to run a browser inside of a Java component such as a JFrame or a JDialog?


回答1:


This should be what you are looking for, a web browser component that you can easily use in your SWING application




回答2:


This would only make the URL secret for dummies. With a network sniffer like Ethereal, it would be trivial to know which requests are made by your application. Security through obscurity is always a bad idea.

If you want to do that for other reasons, JEditorPane is able to display HTML and load it from a URL, but its HTML capabilities are very limited compared to a real browser.



来源:https://stackoverflow.com/questions/8548706/java-open-url-inside-of-a-jframe

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