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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.