I want to invoke a browser (e.g. Internet Explorer/Firefox/Google Chrome/Opera) via a Java interface. Also I need to pass some web links to this Java process. How to achieve this?
You can use the desktop API:
java.awt.Desktop.getDesktop().browse(new URI("http://stackoverflow.com"));
This would launch a browser
You can do that with Desktop#browse()
. It would however only launch the system default configured browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With