Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Urgent Please!!!!!!!!!!  RSS feed

 
sreedhar vanam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a password field and sign-on button,my problem is that once i finish entering my password and enter(pressing enter key in keyboard),i want Sign-on button to be activated.So,please help me regarding this.
This is normal process in all sogn-on screens,but i am facing the problem in Swing GUI.
Regards,
Sreedhar
 
Jagan Mohan Reddy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Add actionListener to the password field and submitbutton.
and that solves ur problem.

passwordField.addActionListener(this);
submitButton.addActionListener(this);
In Listener the code will be something like this.

public void actionPerformed(ActionEvent ae) {
System.out.println("Hello");
}

Regards,
Jagan Mohan Reddy.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!