Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding web browser window in Java

Does anyone know a way to open up an instance of the platform's (Windows/Linux/Mac) browser within a Swing window that is integrated into a Java application. No other actions would be preformed other than opening a given URL. Currently, we open a new browser window because the Java embedded browsers have been insufficient. However, from a user interaction standpoint this is less than desirable.

I'm curious if a solution for this was part of the 1.6 Java release. So, far my google-foo has not turned up anything of note. Are there any closed-source libraries that do this? Anything?

like image 848
Elijah Avatar asked Nov 17 '08 03:11

Elijah


People also ask

Can you make a web browser in Java?

To make the simple web browser work, we need to write some codes inside the JFrame class. For that, switch the Design to Source mode in the BrowserForm pane. Add a method to set the web page to browserPane and the web address text to addressField that is wrapped by the try-catch block.

How web Browsers are used in Java?

It is easily embedded within an HTML page and is a client-side concept i.e. runs on client-side. So, to run Applet, we need a Java-enabled browser. Browsers come with a Java plugin that allows the execution of an Applet on it. And so, the browsers that come to Java enabled, can run Applet without any hassle.

Can Java Swing be used in web applications?

Webswing is a web server that allows you to run any Java Swing application inside your web browser, using only pure HTML5.


2 Answers

JDIC

like image 112
ykaganovich Avatar answered Oct 14 '22 19:10

ykaganovich


We use JDIC as well and it works for us in Windows; however, configuring it to work in *nix/OS X can be a pain, as it simply utilizes a platform-native browser (supports IE and Mozilla), while on Linux/Mac you may have neither - that's the problem.

like image 1
Sergey Borodavkin Avatar answered Oct 14 '22 19:10

Sergey Borodavkin