Here you can find the source of getRandomColor()
public static Color getRandomColor()
//package com.java2s; //License from project: Open Source License import static java.lang.Math.random; import java.awt.Color; public class Main { public static Color getRandomColor() { return new Color((int) (random() * 255), (int) (random() * 255), (int) (random() * 255)); }/*from ww w.j av a2 s . c o m*/ }