I have this code here
public void actionPerformed(ActionEvent arg0) {
for (int i = 0; i <= 360; i++){
for (int z = 0; z < 9; z++){
xaxisWave1 [z][i] -= 1;
if (xaxisWave1[z][360] < 0){
System.out.println("Line out");
for (int y = 0; y <= 360; y ++){
xaxisWave1[z][y] += 1000;
}
}
}
}
for (int i = 0; i <= 360; i++){
for (int z = 0; z < 9; z++){
xaxisWave2 [z][i] -= 15;
}
}
repaint();
}
This should make it so what every time a sine wave goes off of the screen it reprints at 1000 px along the x axis. I have multiple sine waves and it should sense it going off of the screen for all of them, but for some reason it only senses the first one. What is the problem? Thanks.