Starting Browser from java Application


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Starting Browser from java Application

  1. #1
    Join Date
    Jul 2006
    Posts
    6

    Starting Browser from java Application

    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

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560

    Try this..

    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();
      }
    }
    eschew obfuscation

  3. #3
    Join Date
    Jul 2006
    Posts
    6
    Dear sjalle,

    Thank you for the reply

    ben1967

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2006, 04:16 PM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 07:46 AM
  3. Recommending a technology
    By Michael Gautier in forum Architecture and Design
    Replies: 35
    Last Post: 09-16-2002, 09:32 AM
  4. Replies: 1
    Last Post: 12-10-2001, 11:48 AM
  5. Java Web Application Developer at Montclare Technologies
    By Montclare Technologies in forum Java
    Replies: 0
    Last Post: 09-20-2000, 03:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center