I want to open new browser window from java desktop application. If browser is already open, then new browser window should open. Every time it should open a separate window.
Asked
Active
Viewed 3,893 times
2
-
2http://stackoverflow.com/questions/5226212/how-to-open-the-default-webbrowser-using-java – Dylan Meeus Dec 01 '15 at 12:05
-
this will open a new tab in default browser. I want to open new window – Ankit Kumar Singhal Dec 01 '15 at 12:08
2 Answers
2
The builtin mechanism for "opening a browser" would be
Desktop.getDesktop().browse(new URI("http://your.link..."))
Starting a new window / process each time might only be possible if you know the browser being used and know of a parameter to pass to always create new window.

Jan
- 13,738
- 3
- 30
- 55
1
If you are using windows, this should do the trick:
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler http://www.google.com");
Hope it helps.

hcarrasko
- 2,320
- 6
- 33
- 45
-
1as my browser is already opened, i want to open a separate window. It is opening a new tab in the already opened window. – Ankit Kumar Singhal Dec 01 '15 at 12:16
-