Reputation: 1333
I am trying to call the function on the click of the value selected in spinner(DropDownBox in java). As spinner take 1 value default it display the data but(It's fetching the data from the databsae) when i am selecting the other value the size of my array was the same as the value which selected default.The size of my array won't change.Any suggestion or help appreciated. Thanks in advance {This is my edited code]1
Upvotes: 0
Views: 286
Reputation: 31182
Arrays are fixed size by definition. You probably want to use ArrayList<Type>()
.
BTW, looking at your code, I suggest you use String.split()
instead of StringTokenizer
. It's much simpler.
Upvotes: 2
Reputation: 1858
Array size cannot change! You can use ArrayList instead and then convert back to array if necessary
Upvotes: 2