Hi
I was looking around and saw this piece of code posted by Cotton.m:
public class IETest{
public final static String browserPath ="C:\\Program Files\\Internet Explorer\\iexplore.exe";
public static void main(String args[])throws Exception{
String[] urls = {"http://forum.java.sun.com","http://www.cnn.com","http://www.google.com"};
for(int i=0;i<urls.length;i++){
launchPage(urls);
}
}
public static void launchPage(String pageName)throws Exception{
String[] launchPath = new String[2];
launchPath[0] = browserPath;
launchPath[1] = pageName;
Runtime.getRuntime().exec(launchPath);
}
}
Does anyone know how to not hardcode the browserPath? or is that impossible... I'm doing something similar but I open files... is there a way that I don't need to hard code the path name? or am i asking too much?
Cheers>