If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Web Browser

Hello

I was just wondering if there was anyone out there that had any code for displaying an internet page in java ... i want to display a certain page on the net on a JPanel or what ever holds web pages. This page wont ever have to be changed so as long as i can retrieve a certain page from a web server on initialisation i wont ever need to change it....

If you go to the java webpages they have a tutorial for using sockets. These are what you use for network communications (including the internet), and you can easily use them for accessing files on the internet.

As for displaying the page you'll need something that understands HTML. There is something in the standard API that can do that, I think its JEditorPane but i'm not 100% sure. It shouldn't be too hard to find. I don't have any actual code, but it shouldn't be too hard to write it yourself after reading the tutorial. Most of it will already be encapsulated in the Sockets classes. You will just need to create one and point it at the right URL.