Here you can find the source of getRandom()
public static Color getRandom()
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { public static Color getRandom() { int r = randomInt(256), // g = randomInt(256), // b = randomInt(256);/*w w w . j a v a 2 s . c o m*/ return new Color(r, g, b); } private static int randomInt(int n) { return (int) (Math.random() * n); } }