I'm a little noob, so please carry me. I am trying to open many URLs in Internet Explorer right away. About 40 URLs.
I have an array of my urls and I use the following code:
for (int i = 0; i < urls.length; i++){ java.awt.Desktop.getDesktop().browse(java.net.URI.create(urls[i])); }
This works fine if I already have IE open. However, if it does not open, it creates 40 new windows, not tabs. I tried to get around this using the following:
for (int i = 0; i <= 9; i++){ java.awt.Desktop.getDesktop().browse(java.net.URI.create(urls[i])); try { Thread.currentThread().sleep(200); } catch (InterruptedException ex) { Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex); } }
source share