Every AWT & Swing component inherits methods that will enable and disable it, from java.awt.Component. The setEnabled(boolean) method allows a component to be disabled, and later enabled. Previously, AWT components could be enabled and disabled by calling their enable() and disable() methods. However, these methods have been deprecated, and should no longer been used.

// Disable button (b)
b.setEnabled ( false );
// Enable button (b)
b.setEnabled ( true );

Posted in: Java

Related FAQ's

Marius Ion ANGEL HOT SOFT LLC (800) 316-7677