• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting a value from a TextField  RSS feed

 
Stephen Adams
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I hope this is in the correct Forum, if not I applogise.
I am writing an simple login application that takes a username and password enter in a Text field and compares them.
I have want to send the submitted Username and Password into a new class that compares this, I have managed to add an ActionListener and set a action command against the Submit button I have created, but I am not sure how to pass the two values entered in the Username and Password textfields.
How can I get these values?
Do I write:
String passedUsername = Textfield.username.value();
String passedPassword = Textfield.password.value();
void checkDetails(String passedUsername , String passedPassword ))
{
DetailsCheck dc = new DetailsCheck(passedUsername , passedPassword );
}
Is this correct?
Stephen
 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method you are after is getText()
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!