I have written a java script whose work is to open URL's mentioned in the text file and it should repeat this process continuously but the problem is as soon as it reads the new URL mention in next line of text file it opens that URL in new tab but I want to open all the URL's in same tab of chrome browser.
Code what I have written:
while(true){
BufferedReader buf = new BufferedReader(new FileReader("C:\\link.txt"));
String currentLine = null;
while((currentLine = buf.readLine())!=null){
System.out.print(currentLine+"\n");
Desktop.getDesktop().browse(new URL(currentLine).toURI());
Thread.sleep(10000);
}
}
}
Is there any other option then Desktop.getDesktop() that will also work
My text file has two links like this:
https://www.google.co.in/?gfe_rd=cr&ei=y8a_WPTUFLOl8weF8bK4DQ
https://in.yahoo.com/
How to open them in same tab?