application can access by login in web site



Hi all,

Please help me as possible you can.

I will build java application that can access to web site that has
username and password (login)

the program can view sourse for page after login

URL myurl= new URL("http://....";);
URLConnection uc = myurl.openConnection();
/*
it should be here access login
username="name";
password="*******";
after submit, new page will apear
I want this new page

URL myurl2 = new URL("http://new page");
URLConnection uc2 = myurl.openConnection();
*/
BufferedReader in = new BufferedReader(new
InputStreamReader(uc2.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();

Is there any code will help me

Regards;
nova

.