2

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.

Ankit Kumar Singhal
  • 167
  • 1
  • 3
  • 13

2 Answers2

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