Implementing a random color..
I have written this program but I now need to modify it so that if plots each line inside the for loop in a random color:
public class Lines1 extends Applet
public void paint(Graphics g)
for (int y1=120;y1<200;y1++)
Once again, any help is much appreciated.
I've solved it! THanks anyway.
You can specify a new Color like this
Color c=new Color(colorInt);
So you can basically generate random int's and create colors that way. - Check out Math.random().
However, I'm not sure how it will perform if you do this by the thousands...
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center