java - storing data from jtable into array -
i'm using jtable
in application.i want store jtable
data array.while i'm entering data table , when press delete button delete data in cell , click button store data array, shows error numberformatexception
because of pressing delete button.how can solve this? code is
int source = 0; int temp = integer.max_value; int dist = 0; adjacencymatrix = new int[nodes][nodes]; (int row = 0; row < dtm.getrowcount(); row++) { (int col = 1; col < dtm.getcolumncount(); col++) { if (dtm.getvalueat(row, col) == null || (dtm.getvalueat(row, col) == "") || (dtm.getvalueat(row, col) == " ")) { adjacencymatrix[row][col - 1] = integer.max_value; } else { adjacencymatrix[row][col - 1] = integer.parseint((string) dtm.getvalueat(row, col)); // system.out.println("row ----" + row + "------" + (col - 1) + "------" + adjacencymatrix[row][col - 1]); } } } } catch (exception ex) { system.out.println(ex); ex.printstacktrace(); }
}
Comments
Post a Comment