In my Java application, I was able to get the Color of a JButton in terms of red, green and blue; I have stored these values in three int
Color
JButton
int
Random ra = new Random(); int r, g, b; r=ra.nextInt(255); g=ra.nextInt(255); b=ra.nextInt(255); Color color = new Color(r,g,b); String hex = Integer.toHexString(color.getRGB() & 0xffffff); if (hex.length() < 6) { hex = "0" + hex; } hex = "#" + hex;