Possible Duplicate:
Is there a way to embed a browser in Java?
I am working on an application where I have to embed a web browser with application. Any ideas on how to achieve it? Also will I be able to interact JavaScript from within the code?
Possible Duplicate:
Is there a way to embed a browser in Java?
I am working on an application where I have to embed a web browser with application. Any ideas on how to achieve it? Also will I be able to interact JavaScript from within the code?
see this post .... Embed a web browser within a java application
check out Eclipse, it has an embedded browser which is configurable by the user (they support multiple browsers).
you can probably embed their browser even if you use an AWT based application using the AWT_SWT bridge if you are using Java swing application.
this article may help you get started.
For very simple pages, you can use the JEditorPane, which is in the Swing API: see doc
I'm afraid that embedding a real browser is your only option, if you need JavaScript capabily and AJAX etc. look at JavaXPCOM API in order to see how easily you can embed FireFox. There is also JDIC, that will allow you to embed IE in Windows environments. You will need some DLL files but the procedure is straight forward with both APIs and well documented.
Let's admit that JEditorPane is fine, but mainly for HTML you have control over. I use it only to render HTML help files into my application. Once you start visiting sites with it things start getting nasty.