0

Hey guys, I'm bit of a noob so please bear with me. I'm trying to open a lot of urls in internet explorer at once. About 40 urls.

I have an array of my urls and I'm using the following code:

for (int i = 0; i < urls.length; i++){
            java.awt.Desktop.getDesktop().browse(java.net.URI.create(urls[i]));
}

This works perfectly if I already have IE open. However if it's not open already it creates 40 new windows not tabs. I have tried to get around it by 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);
            }
        }

I imagine this is quite inefficient and poorly done. What I would like to do is open an ie window for the first url and then new tabs for the rest of the urls. Is this possible?

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by peter_budo
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.