java - No error yet no output. Help.(Sudoku solver getter) -


i want add text fields a01, a02, ... array a. want display value of val know if text being taken text fields. code not show errors, but, well, doesn't give me output well.

int i, j;  jtextfield[][] = new jtextfield[9][9];  int[][] val = new int[9][9];  (i = 0; < 9; i++) {     (j = 0; j < 9; j++)     {         val[i][j] = integer.parseint(a[i][j].gettext());         system.out.println(val[i][j]);     } } 

it old question here.

you did not give them value

int i,j; // counter jtextfield[][] = new jtextfield[9][9]; for(i=0;i<9;i++) {     for(j=0;j<9;j++)     {         jtextfield tf = new jtextfield();         tf.settext("a"+i+j);         a[i][j] = tf;     } } 

in version call a[i][j].gettext() should throw nullpointerexception. should either kill application, end on console or have somewhere

try { // more code here } catch (exception ex){}

which silently swallow exception , veeeeery bad practice.


Comments

Popular posts from this blog

javascript - Trigger mouseenter when an animated element touches mouse -

json - Zend error Connection -

java - Using Spring @Transactional with a combination of readOnly and write, when does this entity get committed? -