Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Reset or Clear button

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Marshal
Posts: 25594
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 95
Python C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put these lines of code between the lines 145 to 146:

 
David Coello
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

David
 
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic