Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enable/disable a button

Status
Not open for further replies.

johnnyv

Programmer
Jul 13, 2001
216
CA
How can I enable or disable a button on an applet depending on the value of x ie x = true or false

thanks
 
Use the Button class's setEnabled method

eg.
Assuming your button is called 'myButton':

if (x) myButton.setEnabled(true);
else myButton.setEnabled(false);

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top