java : convert string value to int -
to JTable , I follow the row for [row 1] and calculate the values Do: But I found: Your table contains at least one empty cell. Here's a suggestion: Note, method
Last Array List & lt; String & gt; Value = new array list & lt; String & gt; (); End end nb = myTable.getRowCount (); Int sum = 0; (Int i = 1; i & lt; nb; i ++) for {string column = value = myTable.getColumnValue (i, columnName); Yoga = Yoga + Integer.parseInt (columnValue); Value list Add (column value); }
java.lang.NumberFormatException: for input string: "java.lang.NumberFormatException.forInputString (unknown source) Java.lang.Integer.parseInt (unknown source) at Java.lang.Integer.parseInt (unknown source)
Try {sum + = integer.parseont (columnValue) );} Hold (Number Format Expection NFE) {// Cell is either empty or not an integer number //
getColumnValue (int i, string name)
javax.swing. JTable is not defined for . If you use the subclass of
JTable , then there may be an error in that class / method: it is a blank in place of the cell value The string can return.
Comments
Post a Comment