File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes filling an online form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "filling an online form" Watch "filling an online form" New topic

filling an online form

sanjay kumar

Joined: Aug 03, 2007
Posts: 21
Hello Guys,

I want to write a program which will fill in my online form details..example

I want to log to yahoo.
Then fill in my user-id and password.
then fill in a compose mail or another functionality.

is it possible in java?

can some one give me pointers or show me a correct approach

Jilesh Lakhani
Ranch Hand

Joined: Jul 26, 2006
Posts: 49

Yes this is very much possible in JAVA....
well start looking at JSP, HTML, SERVLETS, and some JBDC stuff, combine all of them and you can have your own Web Application.

Universe and Knowledge has no bounderies
sanjay kumar

Joined: Aug 03, 2007
Posts: 21
hello Jilesh,

thanks for reply..
I am talking here about a desktop based program/application which will work as a form filling assitant for me.

are we going in the same direction?
Jilesh Lakhani
Ranch Hand

Joined: Jul 26, 2006
Posts: 49

Well, Desktop Application Java Based ??
so you would be using say Applets or SWING

Yes Even in that Case it is possible!!

Applets and SWING also have this Form capability which you can verify, and yes you need to have some back-end which will verify the password if any.
sanjay kumar

Joined: Aug 03, 2007
Posts: 21
the flow which i want is something like this:

Java Program which I run --> connects to some website (say yahoo) (Question - how?)-->fills in my username and password-->clicks on login

did this make little clear?
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

If you mean that this program should display a Web page in (or as if in) the user's Web browser, but then proceed to fill in the forms on that page: the only way to do that is if your form-filling program is part of the browser itself. That either means

1) Writing a plugin for a specific existing browser (you could easily do this in Javascript as a Firefox plugin, for example -- although of course Firefox itself already has this capability, and many existing plugins extend that capability), or

2) Writing your own Web browser which would have your capability built-in. This you could do in Java, in theory, starting with an HTML component like HTMLEditorKit, but it would be an enormous amount of work, and since modern browsers already have this capability, have little to no benefit. Or

3) Writing a proxy server -- a Java program that sits inbetween the user's browser and the Internet. The proxy server would have a chance to examine and potentially change any of the web pages that passes through it. The Muffin proxy server ( has a plugin architecture, so you might be able to add this capability -- if it's not already in there -- as a Muffin plugin. The user would have to configure their browser to use Muffin as a proxy, and configure Muffin to use their normal proxy (if any).

Now, if you're really interested in just one particular form on one particular web site, there's a fourth option: you can write a desktop Java program which uses the class to submit the form data directly, bypassing the displayed HTML page altogether. But it doesn't sound like that's what you're interested in doing.
[ May 23, 2008: Message edited by: Ernest Friedman-Hill ]

[Jess in Action][AskingGoodQuestions]
sanjay kumar

Joined: Aug 03, 2007
Posts: 21

Thanks for replying!!

I got your approach.

what I was thinking is : I want a generic program
it would connect using the browser to yahoo(or any other)website

move to mail logging page.

fill in my login id & password and login(click login )

that is all i want my program to do.
I agree. Here's the link:
subject: filling an online form
It's not a secret anymore!