vendredi 18 mai 2018

Color.getColor(String, int) - random color

I'm trying to set the random color of JButton object by:

button.setBackground(Color.getColor(null,(int) (Math.random() * 255 + 1)));

but it only produces different shades of blue. Thanks.




Aucun commentaire:

Enregistrer un commentaire