Enabling and Disabling JButton using setEnabled Method

Enabling and Disabling JButton can be easily done using setEnabled Method.JButton class is used to add platform independent buttons to swing programs.

Other JButton Methods are:-

Using JButton setEnabled Method

 

This program is simple.When the user clicks one JButton,the other one becomes disabled.

Output:

Using JButton setEnabled Method