Java AWT Label Foreground Color Example
Chapter:
AWT
Last Updated:
06-06-2016 18:32:04 UTC
Program:
/* ............... START ............... */
import java.applet.Applet;
import java.awt.Color;
import java.awt.Label;
public class JavaAWTLabelForegroundColor extends Applet {
public void init() {
Label label1 = new Label("Java");
Label label2 = new Label("Scan");
add(label1);
add(label2);
label1.setForeground(Color.blue);
label2.setForeground(Color.magenta);
}
}
/* ............... END ............... */
Output
Tags
AWT Label Foreground Color, Java, AWT