accessing web page in java
hi guys,
how can i access the web page in java?
i have tried the following way;;;
import java.io.*;
import javax.swing.*;
public class WebCrawler
{
public static void main(String args[])
{
JFrame frame = new JFrame();
JTextPane pane1=new JTextPane();
pane1.setEditable(false);
frame.add(pane1);
File test = new File("http://www.google.com");
try
{
pane1.setPage(test.toURL());
}
catch(Exception e)
{
e.printStackTrace();
}
frame.setVisible(true);
}
}
but its giving java.io.FileNotFoundException:
i think its because its searching the web page in local directory.
Any idea how to serach it over web

