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 { public static Color getRandomColor() { Random r = new Random(); Color c = new Color(r.nextInt(255), r.nextInt(255), r.nextInt(255)); return c; }/* w ww . ja va 2 s .c o m*/ }