javabrowsernew-window

how to open new browser window from java desktop application code?


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.


Solution

  • If you are using windows, this should do the trick:

    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler http://www.google.com");
    

    Hope it helps.