Below code shows how to disable Java JLabel /** * * @author Eric * Blog:www.techoverload.net * */ import java.awt.Color; import jav...
Below code shows how to disable Java JLabel
/** * * @author Eric * Blog:www.techoverload.net * */ import java.awt.Color; import javax.swing.JLabel; import javax.swing.JFrame; public class JLabelExample extends JFrame{ JLabelExample() { super("JLabel Example"); JLabel label=new JLabel("JLabel Example"); label.setEnabled(false); label.setBounds(10,10,200, 20); add(label); setSize(300,300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLayout(null); setVisible(true); } public static void main(String args[]) { new JLabelExample(); } }