DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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, 03:16 PM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 06:46 AM
  3. Recommending a technology
    By Michael Gautier in forum Architecture and Design
    Replies: 35
    Last Post: 09-16-2002, 08:32 AM
  4. Replies: 1
    Last Post: 12-10-2001, 10:48 AM
  5. Java Web Application Developer at Montclare Technologies
    By Montclare Technologies in forum Java
    Replies: 0
    Last Post: 09-20-2000, 02:58 PM

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links