I'm trying to create an Array of tables (2 tables). My program stops on the last line with a nullpointer exception. Any idea why?
com.lowagie.text.pdf.PdfPTable[] table = new com.lowagie.text.pdf.PdfPTable[1];
// the cell object
com.lowagie.text.pdf.PdfPCell cell;
// header
cell = new PdfPCell(new Phrase(wdComponentAPI.getMessage("Ordernr")));
cell.setColspan(1);
cell.setBackgroundColor(Color.LIGHT_GRAY);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
table[0].addCell(cell);
Arrays dont come created with objects created
PdfPTable [] tables = new PdfPTable[1];
tables[0].doStuff() // null pointer
create the objects inside the array
PdfPTable [] tables = new PdfPTable[1];
tables[0] = new PdfPTable();
tables[0].doStuff() // works good!