Click here to Skip to main content
15,867,879 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I have a arraylist of string , I want to parse this arraylist to my pdfpcell , but my arrayList keep looping here is my code

ArrayList<string> testList = new ArrayList<string>(); 1,2,3

for(i=0; i<testlist.size();>{

new PdfPCell(new Phrase(testList.get(i));

document.add(table);

}

document.close();
Posted

1 solution

Java
for(i=0; i<testlist.size();>{
 
new PdfPCell(new Phrase(testList.get(i));
 
document.add(table);
 
}

Are you saying that you cannot see why the test for i<testlist.size() never fails, since variable i never changes value?
 
Share this answer
 
v2
Comments
Navi.jsp 14-Nov-14 8:59am    
nope. testList is an arrayList when I run my sample output is

1

1
2

1
2
3
Navi.jsp 14-Nov-14 8:59am    
I want it just
1
2
3
Richard MacCutchan 14-Nov-14 12:06pm    
Then add an increment expression to your for statement, as described in https://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900