Here you can find the source of getRandomColor()
public static Color getRandomColor()
//package com.java2s; //License from project: Open Source License import java.awt.Color; import java.util.Random; public class Main { private static final Random RND = new Random(); public static Color getRandomColor() { return new Color(RND.nextInt()); }/*from w ww. j a v a 2 s. c om*/ }