ArrayLists freeze up
in
Programming Questions
•
1 year ago
This code runs but for some reason when the mouseReleased condition is met it freezes. Just wondering if anybody knows why this happens
- ArrayList cx;
- ArrayList cy;
- void setup(){
- size(500,500);
- background(50);
- smooth();
- cx=new ArrayList();
- cy=new ArrayList();
- }
- void draw(){
- for(int i=0;i<cx.size()-1;i++){
- for(int j=0;i<cy.size()-1;j++){
- background(255,0,0);
- float ccx= (Float) cx.get(i);
- float ccy= (Float) cy.get(i);
- stroke(255);
- strokeWeight(10);
- point(ccx,ccy);
- }
- }
- println(frameCount);
- }
- void mouseReleased(){
- cx.add( new Float(mouseX));
- cy.add( new Float(mouseY));
- }
1