Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Embedding Web Browser (prefer Firefox) in Java Application.

976 views
Skip to first unread message

Daniel Pitts

unread,
May 5, 2009, 12:23:47 AM5/5/09
to
I was wondering about and hoping for a way to embed or control a web
browser from within a Java application. It doesn't have to be
cross-platform, but that is a bonus.

It also doesn't have to be Firefox, but that is a big bonus. My project
is basically going to monitor some of my favorite sites, and when they
change, download the latest version of them for offline viewing. It
would be nice if there could be a good integration with FF's rendering
engine.

Thanks,
Daniel.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>

Andrew Thompson

unread,
May 5, 2009, 1:13:33 AM5/5/09
to
On May 4, 9:23 pm, Daniel Pitts

<newsgroup.spamfil...@virtualinfinity.net> wrote:
> I was wondering about and hoping for a way to embed or control a web
> browser from within a Java application. It doesn't have to be
> cross-platform, but that is a bonus.

Check out the https://jdic.dev.java.net/ demo 'Browser'.
"This demo embeds a WebBrowser component to render the
HTML page specified in the URL text field. "
...
"Note: To run this demo, you must use Internet Explorer
or Mozilla (1.4 or a higher version) on Windows platforms;
use Mozilla (1.4 or a higher version) on Linux/Unix
platforms."

F-U set to c.l.j.g. only.

--
Andrew T.
pscode.org

Nigel Wade

unread,
May 5, 2009, 4:50:44 AM5/5/09
to
Daniel Pitts wrote:

> I was wondering about and hoping for a way to embed or control a web
> browser from within a Java application. It doesn't have to be
> cross-platform, but that is a bonus.
>
> It also doesn't have to be Firefox, but that is a big bonus. My project
> is basically going to monitor some of my favorite sites, and when they
> change, download the latest version of them for offline viewing. It
> would be nice if there could be a good integration with FF's rendering
> engine.
>

Do you need to integrate the rendering? Could you use an external FF
application?

As I understand it (it's not something I've even looked into, never mind
actually tried) you can communicate with a running FF process via a socket.
Also, if you run FF and FF determines that another instance is already running
on that display then instead of starting a new instance it sends a message to
the running app. asking it to display the requested URL.

--
Nigel Wade

Daniel Pitts

unread,
May 5, 2009, 1:02:19 PM5/5/09
to
Nigel Wade wrote:
> Daniel Pitts wrote:
>
>> I was wondering about and hoping for a way to embed or control a web
>> browser from within a Java application. It doesn't have to be
>> cross-platform, but that is a bonus.
>>
>> It also doesn't have to be Firefox, but that is a big bonus. My project
>> is basically going to monitor some of my favorite sites, and when they
>> change, download the latest version of them for offline viewing. It
>> would be nice if there could be a good integration with FF's rendering
>> engine.
>>
>
> Do you need to integrate the rendering? Could you use an external FF
> application?
Integrated rendering would be a huge benefit. I'm working on something
that may have an interface similar to a mail reader, so one pane that
lists the items, and another pane that renders the selected item. Having
to load the item into another window would be an unfortunate user
experience.

>
> As I understand it (it's not something I've even looked into, never mind
> actually tried) you can communicate with a running FF process via a socket.
> Also, if you run FF and FF determines that another instance is already running
> on that display then instead of starting a new instance it sends a message to
> the running app. asking it to display the requested URL.
I considered that approach, but I'd rather avoid sockets and processes
where possible. Especially since I'd prefer this to be integrated anyway.

jebblue

unread,
May 6, 2009, 3:36:08 PM5/6/09
to
On Mon, 04 May 2009 21:23:47 -0700, Daniel Pitts wrote:

> I was wondering about and hoping for a way to embed or control a web
> browser from within a Java application. It doesn't have to be
> cross-platform, but that is a bonus.
>
> It also doesn't have to be Firefox, but that is a big bonus. My project
> is basically going to monitor some of my favorite sites, and when they
> change, download the latest version of them for offline viewing. It
> would be nice if there could be a good integration with FF's rendering
> engine.
>
> Thanks,
> Daniel.

Use SWT it has a nice Browser widget.
http://www.eclipse.org/articles/Article-SWT-browser-widget/browser.html

--
// This is my opinion.

Jarrick Chagma

unread,
May 6, 2009, 11:12:38 PM5/6/09
to
"Daniel Pitts" <newsgroup....@virtualinfinity.net> wrote in message
news:vbPLl.2622$%_2....@newsfe04.iad...

> I was wondering about and hoping for a way to embed or control a web
> browser from within a Java application. It doesn't have to be
> cross-platform, but that is a bonus.
>
> It also doesn't have to be Firefox, but that is a big bonus. My project
> is basically going to monitor some of my favorite sites, and when they
> change, download the latest version of them for offline viewing. It would
> be nice if there could be a good integration with FF's rendering engine.

Have you heard about JWebPane? It's a new Swing component that's due in
Java 7 I believe and is basically a Java front end to a WebKit browser pane.
I realise you cannot use it now but you may like to factor it in to your
longer term plans.

--
Regards,

Jarrick

"If you want the car in front of you to go faster, try to overtake it."
__________________________________________________________________________________
[Jarrick...@your.prejudice.gmail.com] (Lose your prejudice before
emailing me)

Daniel Pitts

unread,
May 7, 2009, 12:35:53 PM5/7/09
to
Jarrick Chagma wrote:
> "Daniel Pitts" <newsgroup....@virtualinfinity.net> wrote in
> message news:vbPLl.2622$%_2....@newsfe04.iad...
>> I was wondering about and hoping for a way to embed or control a web
>> browser from within a Java application. It doesn't have to be
>> cross-platform, but that is a bonus.
>>
>> It also doesn't have to be Firefox, but that is a big bonus. My
>> project is basically going to monitor some of my favorite sites, and
>> when they change, download the latest version of them for offline
>> viewing. It would be nice if there could be a good integration with
>> FF's rendering engine.
>
> Have you heard about JWebPane? It's a new Swing component that's due in
> Java 7 I believe and is basically a Java front end to a WebKit browser
> pane. I realise you cannot use it now but you may like to factor it in
> to your longer term plans.
>
That's an idea. I hadn't heard of it before. My application is mostly
for my own use, so I have no problem using not-yet-stable components for
now. I'll look into it.
0 new messages