• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

re-enable buttons

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic