Java Color PINK
Syntax
Color.PINK has the following syntax.
public static final Color PINK
Example
In the following code shows how to use Color.PINK field.
import java.awt.Color;
//from w ww . j a v a 2 s .co m
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Main {
public static void main(String[] args) {
JLabel label = new JLabel("First Name");
label.setForeground(Color.PINK);
JFrame frame = new JFrame();
frame.add(label);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(20,20, 500,500);
frame.setVisible(true);
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »