0

hey,

i have a JTextField, the values entered in to the text field should be added to one dimensional array after a click of a button.
its an int array. the values entered into the text field are separated by a comma i.e. 12,23,2,0,1

how am i meant to separate these values and add each one of them to an array?

any suggestions will be appreciated


thank you

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by NormR1
0

Look at the String class. It has a method for splitting a String into an array of Strings. Then look at the Integer class for a method to convert a String to an int.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.