You can do this with HTML. I'm not familiar with java, but mabey you can think of a way to incorperate this with php.
When you make a HTML text box, the name becomes the variable.
Say you made a HTML form with a text box and a submit button. after you submit the form, and it takes the info...
< input type="text" name ="namehere">
That would make the variable $name="namehere";
you konw what i mean? hope you can find a way to put that with java, good luck.