Dylan Wheeler
Dylan Wheeler

Reputation: 7074

Java Open URL Inside of a JFrame

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?

Upvotes: 0

Views: 2466

Answers (2)

GETah
GETah

Reputation: 21419

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

Upvotes: 2

JB Nizet
JB Nizet

Reputation: 691745

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.

Upvotes: 4

Related Questions