I hava a question about the TextField as follows, should be relative to String accurately. String typedString = textField.getText(); How can I to transfer the typedString to primitive int? I must code myself or can get the result through the java library directly? Thanks in advance.
As the value may be a non-numeric character it is sensible to do this anyway, I think there are static methods of the Number classes like Interger.parseInt(String s) or Double.parseDouble(String s) that throw a number format exception if the string evaluates to number that is out of range or is not a number at all. Hope this helps.
Ever since I found this suit I've felt strange new needs. And a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!