Java Color.getRGB()
Syntax
Color.getRGB() has the following syntax.
public int getRGB()
Example
In the following code shows how to use Color.getRGB() method.
import java.awt.Color;
/*w w w . jav a 2 s . c om*/
public class Main {
public static void main(String[] args) {
Color myColor = Color.RED;
System.out.println(myColor.getRGB());
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »