Set Foreground Color of JLabel - Java Swing

Java examples for Swing:JLabel

Description

Set Foreground Color of JLabel

Demo Code


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*/
}

Related Tutorials