Hi all, Could someone please explain how can I start a browser from a java application, with url passed to browser by the application thank you ben1967
Code: /** * Start a program (IE) with parameters */ import java.io.*; public class BStarter { public BStarter() { try { startExecutable( "C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE http://www.db.no"); } catch (IOException ex) { // oops ex.printStackTrace(); } } private void startExecutable(String cmdStr) throws IOException { Runtime rt=Runtime.getRuntime(); rt.exec(cmdStr); } public static void main(String[] args) { BStarter b = new BStarter(); } }
/** * Start a program (IE) with parameters */ import java.io.*; public class BStarter { public BStarter() { try { startExecutable( "C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE http://www.db.no"); } catch (IOException ex) { // oops ex.printStackTrace(); } } private void startExecutable(String cmdStr) throws IOException { Runtime rt=Runtime.getRuntime(); rt.exec(cmdStr); } public static void main(String[] args) { BStarter b = new BStarter(); } }
eschew obfuscation
Dear sjalle, Thank you for the reply ben1967
Forum Rules
Development Centers -- Android Development Center -- Cloud Development Project Center -- HTML5 Development Center -- Windows Mobile Development Center