JLabel Background Color In Java Example
Chapter:
Swing
Last Updated:
17-06-2016 16:30:39 UTC
Program:
/* ............... START ............... */
import java.awt.Color;
import javax.swing.JApplet;
import javax.swing.JLabel;
public class JavaSwingJLabelBackgroundColor extends JApplet {
public void init() {
JLabel label1 = new JLabel(" Background Color ");
Color backgroundColor = new Color(10, 10, 255);
label1.setOpaque(true);
label1.setBackground(backgroundColor);
add(label1);
}
}
/* ............... END ............... */
Output
Tags
JLabel Background Color, Java, Swing