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

Reset or Clear button

David Coello

Joined: Jun 05, 2012
Posts: 22
Hello forum members,

I am currently working on an applet and need to include a clear or reset button and have researched with no solution found. I want to reset the name text field to be blank and ready to receive a new name.

Any help is appreciated. Thank you.

My code as follows:

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Then you would put a line of code between lines 145 and 146 to do that. Was that your question? Or did you mean to ask which line of code you should put there?
Naishadh Parmar
Ranch Hand

Joined: Jun 02, 2011
Posts: 95

Put these lines of code between the lines 145 to 146:

David Coello

Joined: Jun 05, 2012
Posts: 22
Thank you so much Paul and Naishadh for your help; I actually played around with the code before posting for help and almost got to that same code, but this worked perfect, thank you I appreciate it!!
David Coello

Joined: Jun 05, 2012
Posts: 22
Hi, well I thought of another quick question. When I run the applet on Eclipse, the labels are all over the applet.

1.- Is there a way to organize the applet contents, like in columns or rows.
2. Is there a way to move the second part of the applet. (name, gender, age, etc.), I would like to move it down a little to make more room for the labels.

Your help is really appreciated.

Thank you.

I agree. Here's the link:
subject: Reset or Clear button
jQuery in Action, 3rd edition