Disable JLabel - Java Swing

Java examples for Swing:JLabel

Description

Disable JLabel

Demo Code


import javax.swing.JApplet;
import javax.swing.JLabel;
 
public class Main {
 
        public void init(){
                JLabel label1 = new JLabel("JLabel Disable Example.");
                label1.setEnabled(false);
                /*/* w w w  . j  a v a  2  s .  c om*/
                 * To re-enable the same JLabel use
                 * setEnabled(true) method.
                 */
        }
}

Related Tutorials