Here you can find the source of getRandomColor()
private static Color getRandomColor()
//package com.java2s; //License from project: Open Source License import java.awt.Color; import java.util.Random; public class Main { /**/*ww w . j a v a2s . co m*/ * Gets random RGB color * @return Color, random color */ private static Color getRandomColor() { Random randomGenerator = new Random(); int r = randomGenerator.nextInt(256); int g = randomGenerator.nextInt(256); int b = randomGenerator.nextInt(256); return new Color(r, g, b); } }