Here you can find the source of randomColor()
public static Color randomColor()
//package com.java2s; //License from project: Apache License import java.awt.Color; public class Main { public static Color randomColor() { int c = (int) (Math.random() * 255); return new Color(Math.abs(c * 25) % 255, Math.abs(17 * c) % 255, Math.abs(34 * c) % 255); }/*from ww w .j av a2 s . c o m*/ }