Here you can find the source of getRandomIntColor()
private static int getRandomIntColor()
//package com.java2s; import java.util.Random; public class Main { private static Random random = new Random(); private static int getRandomIntColor() { int[] rgb = getRandomRgb(); int color = 0; for (int c : rgb) { color = color << 8;/* ww w .j a va 2 s . c o m*/ color = color | c; } return color; } private static int[] getRandomRgb() { int[] rgb = new int[3]; for (int i = 0; i < 3; i++) { rgb[i] = random.nextInt(255); } return rgb; } }