Java AWT Label Background Color Example
Chapter:
AWT
Last Updated:
06-06-2016 18:15:14 UTC
Program:
/* ............... START ............... */
import java.applet.Applet;
import java.awt.Color;
import java.awt.Label;
public class JavaAWTLabelBackground extends Applet {
public void init() {
Label label1 = new Label("Java");
Label label2 = new Label("Scan ");
// add labels
add(label1);
add(label2);
label1.setBackground(Color.green);
label2.setBackground(Color.red);
}
}
/* ............... END ............... */
Output
Tags
AWT Label Background Color, Java, AWT