aspose file tools*
The moose likes Java in General and the fly likes How to open internet explorer with desired site address..reply urgently Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to open internet explorer with desired site address..reply urgently" Watch "How to open internet explorer with desired site address..reply urgently" New topic
Author

How to open internet explorer with desired site address..reply urgently

p sata
Greenhorn

Joined: Feb 26, 2001
Posts: 5


import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.*;
import java.net.URL;
public class Try extends JPanel implements ActionListener
{
JButton jb1;
public static void main(String[] args)
{
JFrame frame= new JFrame("Pinal");
frame.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.getContentPane().add(new Try(), BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
Try()
{
jb1 = new JButton("Click Me");
jb1.addActionListener(this);
add(jb1);
}


public void actionPerformed(ActionEvent e)
{

Runtime r = Runtime.getRuntime();
Process p = null;
try
{
//URL hp = new URL("http://www.yahoo.com");
p = r.exec("C:/Program Files/Internet Explorer/iexplore.exe");

}
catch (Exception ex)
{
System.out.println("Hello " + ex);
}
}

}



With above programm my explorer is opning... but not with url i specified...
This all requirment is for standalone application....
gautham kasinath
Ranch Hand

Joined: Dec 01, 2000
Posts: 583
Hi!
Well just chk the path u r giving ..

it works I tried just now..
Regds
Gautham Kasinath


"In the country of the blind, the one eyed man is the King"
Gautham Kasinath CV at : http://www.geocities.com/gkasinath
p sata
Greenhorn

Joined: Feb 26, 2001
Posts: 5
hey thanx things are working....

public void actionPerformed(ActionEvent e)
{

Runtime r = Runtime.getRuntime();
Process p = null;
try
{
String abc = "http://www.yahoo.com";
String ab = "C:/Program Files/Internet Explorer/iexplore.exe " + abc;
p = r.exec(ab);

}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to open internet explorer with desired site address..reply urgently