1

How can I open a webpage from a java application and enter username and password into it? I have seen questions here where people have referred to lobo or DJ Native Swing.

But as I am very new to java these libraries seem quite complex to me and I can not find a good tutorial in it, please refer to some good library with a solid tutorial which can be a beginning ground for me.

Note: I am developing a Java Swing application and show the user a page opening and user name and password being submitted.

Cœur
  • 37,241
  • 25
  • 195
  • 267
S. A. Malik
  • 3,465
  • 6
  • 37
  • 56

4 Answers4

1

Take a look at Apache's HttpComponents project

Mike C
  • 3,077
  • 22
  • 29
1

What application do you develop? Web? Desktop/swing? Console? Mobile?

user996142
  • 2,753
  • 3
  • 29
  • 48
0

It is not clear what you want to do.

1) Do you want to show it to the user? join to WebKit browser in Java app on multiple platforms

2) You want to fetch some data from a web page that requires login? then you should join to HttpClient login, search and get the XML content

Community
  • 1
  • 1
jorgeu
  • 689
  • 6
  • 14
  • I want to show it to user. i.e he should see a page opening, login information being filled in the form and login button pressed. – S. A. Malik Dec 02 '11 at 15:29
0

Your question is not clear, are you trying to write a java application that will open a browser and enter data automatically?

If this is what you want then you can use selenium, a plugin for Mozilla. You can record your mouse movements, all your actions will get recorded as a jUnit test case.

You can then modify this junit test and read in the usernanme and password programatically from a file (or what ever you are trying to do.). This test can be run as a stand alone java application.

aronzygo
  • 51
  • 4
  • What is not clear in the question ? I can not use selenium as i have to perform other functions also, so an independent application is a complete no no ! – S. A. Malik Dec 02 '11 at 15:46