프레임 데이터의 오른쪽 부분을 복사하려고합니다. 아래 이미지가 유용 할 수 있습니다. 데이터는 단일 배열 형식입니다.배열의 특정 요소를 다른 배열에 복사
나는 데이터 프레임의 단일 배열 오른쪽 열을 싶어. "스레드의 예외"메인 "java.lang.ArrayIndexOutOfBoundsException: 1000
"이 나타납니다. 나는 무엇이 잘못되었는지 확신하지 못한다. 스레드 "메인"java.lang.ArrayIndexOutOfBoundsException에
예외 : 1000
public static void main(String args[]) {
int height=10;
int width = 100;
int data[]= new int [height*width];
int multipiler=0;
int counter =1;
int hwAssistWidth=5;
int hwData[] = new int[hwAssistWidth*height];
int countTheFrame = 0;
int countTheFrame1 = 0;
int sourceArray;
for(int i=0; i<hwAssistWidth*height; i++){
sourceArray = ((width-hwAssistWidth)+width*multipiler)+counter++;
hwData[i] = data[sourceArray];
if (counter==hwAssistWidth+1){
counter =1;
multipiler++;
if(multipiler==height){
break;
}
}
}
}
프로그램을 디버그 했습니까? – f1sh
예, 했어요. 데이터 배열 내부의 값은 무시하십시오. – ZeSamPam
색인에 배열 데이터가 없기 때문에 –