Java examples for Swing:JLabel
Set Foreground Color of JLabel
import java.awt.Color; import javax.swing.JApplet; import javax.swing.JLabel; public class Main { public void init(){ JLabel label1 = new JLabel("JLabel Set Forground Color Example."); Color customColor = new Color(10,10,255); label1.setForeground(customColor); }/*w ww . j a v a 2 s. com*/ }