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 testList = new ArrayList(); 1,2,3

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

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

document.add(table);

}

document.close();

I don't know anything about PdfPCell, but it looks odd that you create new instance of it on line 7, but you don't do anything with it. Similarly you add a table on each pass of the loop, but I don't see any code to change table's value in the loop.

The PdfPCell API JavaDoc lists a getTable method - is that maybe something you missed out???

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.