112 */ |
112 */ |
113 public int getValue() { |
113 public int getValue() { |
114 if (getText().isEmpty()) { |
114 if (getText().isEmpty()) { |
115 return 0; |
115 return 0; |
116 } else { |
116 } else { |
117 return Integer.valueOf(getText()); |
117 return Integer.parseInt(getText()); |
118 } |
118 } |
119 } |
119 } |
120 |
120 |
121 /** |
121 /** |
122 * Sets the field's value. |
122 * Sets the field's value. |
123 * |
123 * |
124 * @param v the number from 1 to 9 or zero to clear the field |
124 * @param v the number from 1 to 9 or zero to clear the field |
|
125 * @throws IllegalArgumentException if v is not between 0 and 9 |
125 */ |
126 */ |
126 public void setValue(int v) { |
127 public void setValue(int v) { |
127 if (v == 0) { |
128 if (v == 0) { |
128 setText(""); |
129 setText(""); |
129 } else if (v < 10) { |
130 } else if (v < 10) { |