• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

re-enable buttons

 
Walter Rust
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program with four buttons. One of the buttons clears the text from a textfield AND disables the other three buttons. What I would like to be able to do is be able to click into the textfield and have this action (the clicking into) re-enable the other three buttons. If need be, I'll post the class
 
Eli Daum
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just call a method that checks a boolean condition that you would want to satisfy and then call button.setEnabled(true);
also add a mouse clicked event for the text area and setEnabled(true); when someone fires the event (by clicking inside the text area)
[ August 12, 2002: Message edited by: Eli Daum ]
 
Thomas Suer
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You also could add a FocusListener to your textarea and handle the enabling mechanism of the desired buttons when the textarea gets the focus. This would have the advantage that enabling the buttons also would take place if the user navigates to the textarea via the keyboard...
Good luck
Tom
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic