Reputation: 299
i want to set an array list value in to a text area. this is my code,
ArrayList<String> phone_numberArray = db.getNumberSms();
for(int i=0; i<phone_numberArray.size(); i++){
jtext_area.addElement(phone_numberArray.get(i));
}
this code getting errors. some one help me please....
Upvotes: 1
Views: 4087
Reputation: 7507
Try:
for(String number : db.getNumberSms()) {
jtext_area.append(number);
}
Upvotes: 2
Reputation: 240948
I assume jtext_area
is an instance of JTextArea
, I don't see any addElement()
in that class, You might be looking for append()
Upvotes: 2