An error called outofmemory error is coming up when I am giving nums value > 1. I have underlined where num comes. The strings bla1, bla2 etc, I gave for identifying the error.
private void generateMouseClicked(java.awt.event.MouseEvent evt) {
String s = new String();
String o = new String();
boolean check = true;
o = "";
test.setText("bla-1");
int g[][] = new int[][] {{1,0,0,0,0,0,4,7,9,1},{0,1,0,0,0,0,10,8,1,2},{0,0,1,0,0,0,9,7,7,9},{0,0,0,1,0,0,2,1,8,10},{0,0,0,0,1,0,1,9,7,4},{0,0,0,0,0,1,7,6,7,1}};
int b[] = new int[6];
int d[] = new int[] {0,0,0,0,0,0,0,0,0,0};
test.setText("bla0");
s = input_ph.getText().toString();
int ph = Integer.parseInt(input_ph.getText().toString());
int [U]num[/U] = Integer.parseInt(ph_no_nums.getText().toString());
int ap = 0;
while(num > 0){
test.setText("bla");
for(int i=0;i<6;i++){
b[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
}
for(int i = 0; i < 1; i++) {
for(int j = 0; j < 10; j++) {
for(int k = 0; k < 6; k++){
d[j] += b[k] * g[k][j];
}
if(d[j] >= 10){check = false;}
}
}
test.setText("bla1");
ph += 1;
String m = new String();
String ps = new String();
StringBuffer sb = new StringBuffer();
String last = new String();
m = s;
last = String.valueOf(ph);
test.setText("bla2");
if(last.length()<6){
for(ap=0;ap<(6-(last.length()));ap++){
sb.append('0');
}
ps = sb.toString();
ps = ps.concat(last);
s = ps;
}
else s = last;
sb = null;
display_area.setText("hello");
if(check == true){
o += m + d[6] + d[7] + d[8] + d[9] + '\t' + s + '\t' + ps + '\t' + last + '\n';
num = num - 1;
}
test.setText("bla3");
}
display_area.setText(o);
}