We help IT Professionals succeed at work.
Get Started

How do I concatenate documents using Itext

dan4good
dan4good asked
on
1,383 Views
Last Modified: 2013-11-13
I want to take a series of independently produced ITEXT document objects, each having their own margins and repeatable headers and footers,  add them to a single writerwith bookmarks, then produce a single pdf file.

I have been searching the internet but I can't find what I am looking for. There are several solutions that write each document to file system first and then concatenate or merge them together (such as http://www.roseindia.net/java/itext/ConcatenateMoreThanTwoPdfFiles.shtml and http://java-x.blogspot.com/2006/11/merge-pdf-files-with-itext.html are just two examples). THIS WONT WORK FOR ME. Performance is NOT ACCEPTABLE when you do this in our environment since each write to the hard drive MUSTbe encrypted for security reasons. I am assuming I want to use ByteArrayOutputStream to render the individual docments, but not sure how to aggregate them or finally flush them to a physical file when I am finally ready. The following snippent inNO WAY representsworking source code since it requires functions that don't exist in ITEXT at present, but I am including it because it might help illustrate what I am lokking for to some of you experts better than this explanation does.
package in_action.chapter01;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;

import com.lowagie.text.Document;
import com.lowagie.text.pdf.PdfCopy;
import com.lowagie.text.pdf.PdfImportedPage;


public class MyItextWishClass {

	public static void assembleIntoOnePDF() {

		try {
			List <Document> documentList = new ArrayList<Document>();
			/**
			 * each of the following 4 lines represents the calls needed to  retrieve the independently produced ITEXT Document Objects
			 * a sample document object follows this snippet.
			 */
			documentList.add(CoverPage.getDocument());
			documentList.add(ReportOne.getDocument());
			documentList.add(ReportTwo.getDocument());
			documentList.add(ReportThree.getDocument());


			String outFile; // represents final physical location of aggregated PDF. 
			Document document = null;
			PdfCopy writer = null;
			PdfImportedPage page;
			int idx = 0;
			while (idx < documentList.size()) {						
				document = documentList.get(idx);

				writer = new PdfCopy(document, new FileOutputStream(outFile));
				document.open();						
				// step 4: we somehow add content of each document to writer


				idx++;
			}
			// step 5: we close the document
			document.close();
		}
		catch(Exception e) {
			e.printStackTrace();
		}
	}
}

///////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!////
Sample report generating logic to follow......

package com.mm.isip.reportLayer.reports.traditionalproduct;

import java.awt.Color;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

import com.lowagie.text.Cell;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Image;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;

import com.mm.isip.print.PrintContext;
import com.mm.isip.print.PrintEngine;

public class CoverPage implements DocumentPrintComponent {
	private static final String LINEBREAK = "\n";
	private static final float topBORDER = 5f;
	private static final float leftBORDER = 5f;
	private static final float rightBORDER = 15.75f;
	private static final Color borderCOLOR = Color.blue;
	/**
	 * iText does have it's bizarre little tweaks, just like any other software. iText WILL ALWAYS GIVE
	 * you a default margin of .5 in. or so So if you want to cut that, you need to make -36. 
	 */
	private static final float leftMARGIN = -36f;
	private static final float rightMARGIN = -36f;
	private static final float topMARGIN = 18f;
	private static final float bottomMARGIN = 18f;
	
	/**
	 * add a 1/4 inch of additional padding for page content. 
	 */
	private static final float leftPADDING = 18f;
	
public static Document print(PrintContext cxt) {
	Document document = new Document();
	PdfWriter writer = null;		
	//TODO "Totalpages" needs to be retrieved programatically
	String totalpages = "37";
	String insuredDemographicData = "";
	String insured = PreparedFor.getValue(cxt);	
	String crnnumber = CRNCodeByProduct.getValue(cxt);
	String presentedby = PreparedByAddress.getValue(cxt);
	String preparedOnDate = FooterPreparedOnDate.getValue(cxt);	
		
	String productName = "";
	String pension = Pension.getValue(cxt);
	String planName = MarketingNameForCoverPage.getValue(cxt);
	String coverageDescription = CoverageLISR.getValue(cxt);
	String revisedIllustration = RevisedIllustration.getValue(cxt);
	insuredDemographicData = Gender.getValue(cxt)+ ", Age " + ClientAge.getValue(cxt); 
		
	String pagenumber = "1 of " + totalpages;

	try {
		PrintEngine pe = cxt.getPrintEngine();
		ByteArrayOutputStream byteArrayPDFContainer = new ByteArrayOutputStream();
		writer = PdfWriter.getInstance(document, byteArrayPDFContainer);
			
		document.open();

		PdfPTable layout = new PdfPTable(1);
		Phrase blank = new Phrase("\n");

		layout.getDefaultCell().setBorder(Cell.NO_BORDER);
		layout.getDefaultCell().setPadding(0f);
			
		layout.setTotalWidth(100f);
			
		PdfPCell contentcell = null;			
		PdfPCell leftcell = null;
		PdfPCell rightcell = null;

		PdfPTable table = new PdfPTable(2);			
		table.setTotalWidth(document.right() - document.left());	
		table.getDefaultCell().setPadding(0f);
		table.getDefaultCell().setBorder(Cell.NO_BORDER);
			
		leftcell = new PdfPCell(new Phrase("LIFE INSURANCE", pe.getHelv10PointBoldFont() ));
		leftcell.setHorizontalAlignment(Element.ALIGN_CENTER);				
		leftcell.setVerticalAlignment(Element.ALIGN_MIDDLE);
		leftcell.setBackgroundColor(borderCOLOR);
		leftcell.setBorderColor(borderCOLOR);
		leftcell.setBorderWidthLeft(leftBORDER);
		leftcell.setFixedHeight(35);

		rightcell = new PdfPCell(blank);
		rightcell.setBorderWidthTop(topBORDER);
		rightcell.setBorderWidthBottom(0f);
		rightcell.setBorderWidthLeft(0f);
		rightcell.setBorderWidthRight(rightBORDER);
		rightcell.setBorderColor(borderCOLOR);

		table.addCell(leftcell);			
		table.addCell(rightcell);

		layout.addCell(table);

		Phrase phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(70, phrase);
		layout.addCell(contentcell);

		contentcell.setFixedHeight(20);
			
		Chunk chunks[] = new Chunk[2];
		Chunk chunk = new Chunk();
			
		if (pension == null) {
			pension = "";
		}
			
		if (coverageDescription == null) {
			coverageDescription = "";
		}
		productName = pension + planName + coverageDescription;
			
		chunk = new Chunk (productName, pe.get24PointBoldFont());
		chunks[0] = chunk;
						
		if (revisedIllustration == null) {
			revisedIllustration = "";
		}
		chunk = new Chunk (revisedIllustration + LINEBREAK + "Basic Life Insurance Illustration", pe.get22PointBoldFont());
		chunks[1] = chunk;
					
		phrase = PrintEngine.createCompositePhrase(chunks);
		contentcell = setCellDisplayProperties(70, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);

		contentcell.setFixedHeight(10);
		phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(50, phrase);
//		contentcell.setVerticalAlignment(Element.ALIGN_TOP);			
		layout.addCell(contentcell);

		contentcell.setFixedHeight(20);
			
		chunk = new Chunk ("Prepared for:", pe.get18PointBoldFont());
		chunks[0] = chunk;
		chunk = new Chunk (LINEBREAK + insured, pe.get18PointFont());
		chunks[1] = chunk;
			
		phrase = PrintEngine.createCompositePhrase(chunks);
		contentcell = setCellDisplayProperties(50, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);
			
		phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(20, phrase);
		layout.addCell(contentcell);

		contentcell.setFixedHeight(40);
		phrase = new Phrase(insuredDemographicData, pe.get18PointFont());
		contentcell = setCellDisplayProperties(20, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);
			
		phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(20, phrase);
		layout.addCell(contentcell);

		chunk = new Chunk("Presented by:", pe.get18PointBoldFont());
		chunks[0] = chunk;
		chunk = new Chunk (LINEBREAK + presentedby, pe.get18PointFont());
		chunks[1] = chunk;			
		phrase = PrintEngine.createCompositePhrase(chunks);
		contentcell = setCellDisplayProperties(180, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);	

		phrase = new Phrase(preparedOnDate, pe.get18PointFont());
		contentcell = setCellDisplayProperties(20, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);
			
		phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(50, phrase);
		layout.addCell(contentcell);
			
		table = new PdfPTable(2); 
		leftcell = new PdfPCell(new Phrase("CRN: " + crnnumber, pe.get12PointBoldFont()));
		rightcell = new PdfPCell(new Phrase("Page " + pagenumber + " ", pe.get12PointBoldFont()));
		rightcell.setHorizontalAlignment(Element.ALIGN_RIGHT);
			
		leftcell.setBorderColor(borderCOLOR);
		rightcell.setBorderColor(borderCOLOR);
			
		leftcell.setBorderWidthLeft(leftBORDER);			
		leftcell.setBorderWidthTop(0f);
		leftcell.setBorderWidthBottom(0f);
		rightcell.setBorderWidthTop(0f);
		rightcell.setBorderWidthBottom(0f);
		rightcell.setBorderWidthRight(rightBORDER);
			/**
			 * 
			 */
		leftcell.setPaddingLeft(leftPADDING);
		rightcell.setPaddingRight(rightBORDER);
		table.addCell(leftcell);
		table.addCell(rightcell);
		
		layout.addCell(table);
		PdfPTable footer = new PdfPTable(1);
		footer.getDefaultCell().setPadding(0f);
		footer.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
		footer.getDefaultCell().setBorderWidthLeft(0f);
		footer.getDefaultCell().setBorderWidthRight(0f);
		footer.getDefaultCell().setBorderWidthBottom(0f);
		footer.getDefaultCell().setBorderWidthTop(0f);
		footer.getDefaultCell().setBorderColor(Color.GREEN);
			
		Image image = Image.getInstance("src/main/resources/images/report_image.jpg");
			
		contentcell.setImage(image);
		contentcell.setFixedHeight(70);
			
		contentcell.setPaddingBottom(0f);
		contentcell.setBorderWidthBottom(1f);
		contentcell.setBorderColorBottom(Color.CYAN);
			
		contentcell.setBorderWidthTop(0f);	
			
		contentcell.setPaddingLeft(leftBORDER);			
		contentcell.setBorderWidthLeft(leftBORDER);
			
		contentcell.setPaddingRight(0.0f);
		contentcell.setBorderWidthRight(rightBORDER);
		footer.addCell(contentcell);
		layout.addCell(footer);	
			
		PdfPCell disclaimer = null;
		String verbiage = "bla bla bla.";
		disclaimer = new PdfPCell(new Phrase( verbiage, pe.get10PointFont()));
		disclaimer.setBorder(Cell.NO_BORDER);
		layout.addCell(disclaimer);							

		document.add(layout);
			
	} catch (DocumentException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	}
	return document;
}


	private static PdfPCell setCellDisplayProperties(float fixedHeight, Phrase phrase) {
		PdfPCell cell2Display = new PdfPCell(phrase);
		cell2Display.setFixedHeight(fixedHeight);
		cell2Display.setBorderColor(borderCOLOR);
		cell2Display.setBorderWidthLeft(leftBORDER);
		cell2Display.setBorderWidthRight(rightBORDER);		
		cell2Display.setBorderWidthBottom(0f);
		cell2Display.setBorderWidthTop(0f);
		return cell2Display;
	}	
}

Open in new window

package in_action.chapter01;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;

import com.lowagie.text.Document;
import com.lowagie.text.pdf.PdfCopy;
import com.lowagie.text.pdf.PdfImportedPage;


public class MyItextWishClass {

	public static void assembleIntoOnePDF() {

		try {
			List <Document> documentList = new ArrayList<Document>();
			/**
			 * each of the following 4 lines represents the calls needed to  retrieve the independently produced ITEXT Document Objects. Each document object 
implements the DocumentPrintComponent interface which has a single public method public void print(PrintContext)
			 * a sample document object follows this snippet.
			 */
			documentList.add(coverPage.getDocument());
			documentList.add(reportOne.getDocument());
			documentList.add(reportTwo.getDocument());
			documentList.add(reportThree.getDocument());


			String outFile; // represents final physical location of aggregated PDF. 
			Document document = null;
			PdfCopy writer = null;
			PdfImportedPage page;
			int idx = 0;
			while (idx < documentList.size()) {						
				document = documentList.get(idx);

				writer = new PdfCopy(document, new FileOutputStream(outFile));
				document.open();						
				// step 4: we somehow add content of each document to writer


				idx++;
			}
			// step 5: we close the document
			document.close();
		}
		catch(Exception e) {
			e.printStackTrace();
		}
	}
}

///////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!////
Sample report generating logic to follow......

package com.mm.isip.reportLayer.reports.traditionalproduct;

import java.awt.Color;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

import com.lowagie.text.Cell;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Image;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;

import com.mm.isip.print.PrintContext;
import com.mm.isip.print.PrintEngine;

public class CoverPage implements DocumentPrintComponent {
	private static final String LINEBREAK = "\n";
	private static final float topBORDER = 5f;
	private static final float leftBORDER = 5f;
	private static final float rightBORDER = 15.75f;
	private static final Color borderCOLOR = Color.blue;
	/**
	 * iText does have it's bizarre little tweaks, just like any other software. iText WILL ALWAYS GIVE
	 * you a default margin of .5 in. or so So if you want to cut that, you need to make -36. 
	 */
	private static final float leftMARGIN = -36f;
	private static final float rightMARGIN = -36f;
	private static final float topMARGIN = 18f;
	private static final float bottomMARGIN = 18f;
	
	/**
	 * add a 1/4 inch of additional padding for page content. 
	 */
	private static final float leftPADDING = 18f;
	
public static Document print(PrintContext cxt) {
	Document document = new Document();
	PdfWriter writer = null;		
	//TODO "Totalpages" needs to be retrieved programatically
	String totalpages = "37";
	String insuredDemographicData = "";
	String insured = PreparedFor.getValue(cxt);	
	String crnnumber = CRNCodeByProduct.getValue(cxt);
	String presentedby = PreparedByAddress.getValue(cxt);
	String preparedOnDate = FooterPreparedOnDate.getValue(cxt);	
		
	String productName = "";
	String pension = Pension.getValue(cxt);
	String planName = MarketingNameForCoverPage.getValue(cxt);
	String coverageDescription = CoverageLISR.getValue(cxt);
	String revisedIllustration = RevisedIllustration.getValue(cxt);
	insuredDemographicData = Gender.getValue(cxt)+ ", Age " + ClientAge.getValue(cxt); 
		
	String pagenumber = "1 of " + totalpages;

	try {
		PrintEngine pe = cxt.getPrintEngine();
		ByteArrayOutputStream byteArrayPDFContainer = new ByteArrayOutputStream();
		writer = PdfWriter.getInstance(document, byteArrayPDFContainer);
			
		document.open();

		PdfPTable layout = new PdfPTable(1);
		Phrase blank = new Phrase("\n");

		layout.getDefaultCell().setBorder(Cell.NO_BORDER);
		layout.getDefaultCell().setPadding(0f);
			
		layout.setTotalWidth(100f);
			
		PdfPCell contentcell = null;			
		PdfPCell leftcell = null;
		PdfPCell rightcell = null;

		PdfPTable table = new PdfPTable(2);			
		table.setTotalWidth(document.right() - document.left());	
		table.getDefaultCell().setPadding(0f);
		table.getDefaultCell().setBorder(Cell.NO_BORDER);
			
		leftcell = new PdfPCell(new Phrase("LIFE INSURANCE", pe.getHelv10PointBoldFont() ));
		leftcell.setHorizontalAlignment(Element.ALIGN_CENTER);				
		leftcell.setVerticalAlignment(Element.ALIGN_MIDDLE);
		leftcell.setBackgroundColor(borderCOLOR);
		leftcell.setBorderColor(borderCOLOR);
		leftcell.setBorderWidthLeft(leftBORDER);
		leftcell.setFixedHeight(35);

		rightcell = new PdfPCell(blank);
		rightcell.setBorderWidthTop(topBORDER);
		rightcell.setBorderWidthBottom(0f);
		rightcell.setBorderWidthLeft(0f);
		rightcell.setBorderWidthRight(rightBORDER);
		rightcell.setBorderColor(borderCOLOR);

		table.addCell(leftcell);			
		table.addCell(rightcell);

		layout.addCell(table);

		Phrase phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(70, phrase);
		layout.addCell(contentcell);

		contentcell.setFixedHeight(20);
			
		Chunk chunks[] = new Chunk[2];
		Chunk chunk = new Chunk();
			
		if (pension == null) {
			pension = "";
		}
			
		if (coverageDescription == null) {
			coverageDescription = "";
		}
		productName = pension + planName + coverageDescription;
			
		chunk = new Chunk (productName, pe.get24PointBoldFont());
		chunks[0] = chunk;
						
		if (revisedIllustration == null) {
			revisedIllustration = "";
		}
		chunk = new Chunk (revisedIllustration + LINEBREAK + "Basic Life Insurance Illustration", pe.get22PointBoldFont());
		chunks[1] = chunk;
					
		phrase = PrintEngine.createCompositePhrase(chunks);
		contentcell = setCellDisplayProperties(70, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);

		contentcell.setFixedHeight(10);
		phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(50, phrase);
//		contentcell.setVerticalAlignment(Element.ALIGN_TOP);			
		layout.addCell(contentcell);

		contentcell.setFixedHeight(20);
			
		chunk = new Chunk ("Prepared for:", pe.get18PointBoldFont());
		chunks[0] = chunk;
		chunk = new Chunk (LINEBREAK + insured, pe.get18PointFont());
		chunks[1] = chunk;
			
		phrase = PrintEngine.createCompositePhrase(chunks);
		contentcell = setCellDisplayProperties(50, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);
			
		phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(20, phrase);
		layout.addCell(contentcell);

		contentcell.setFixedHeight(40);
		phrase = new Phrase(insuredDemographicData, pe.get18PointFont());
		contentcell = setCellDisplayProperties(20, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);
			
		phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(20, phrase);
		layout.addCell(contentcell);

		chunk = new Chunk("Presented by:", pe.get18PointBoldFont());
		chunks[0] = chunk;
		chunk = new Chunk (LINEBREAK + presentedby, pe.get18PointFont());
		chunks[1] = chunk;			
		phrase = PrintEngine.createCompositePhrase(chunks);
		contentcell = setCellDisplayProperties(180, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);	

		phrase = new Phrase(preparedOnDate, pe.get18PointFont());
		contentcell = setCellDisplayProperties(20, phrase);
		contentcell.setPaddingLeft(leftPADDING);
		layout.addCell(contentcell);
			
		phrase = new Phrase("", pe.get18PointFont());
		contentcell = setCellDisplayProperties(50, phrase);
		layout.addCell(contentcell);
			
		table = new PdfPTable(2); 
		leftcell = new PdfPCell(new Phrase("CRN: " + crnnumber, pe.get12PointBoldFont()));
		rightcell = new PdfPCell(new Phrase("Page " + pagenumber + " ", pe.get12PointBoldFont()));
		rightcell.setHorizontalAlignment(Element.ALIGN_RIGHT);
			
		leftcell.setBorderColor(borderCOLOR);
		rightcell.setBorderColor(borderCOLOR);
			
		leftcell.setBorderWidthLeft(leftBORDER);			
		leftcell.setBorderWidthTop(0f);
		leftcell.setBorderWidthBottom(0f);
		rightcell.setBorderWidthTop(0f);
		rightcell.setBorderWidthBottom(0f);
		rightcell.setBorderWidthRight(rightBORDER);
			/**
			 * 
			 */
		leftcell.setPaddingLeft(leftPADDING);
		rightcell.setPaddingRight(rightBORDER);
		table.addCell(leftcell);
		table.addCell(rightcell);
		
		layout.addCell(table);
		PdfPTable footer = new PdfPTable(1);
		footer.getDefaultCell().setPadding(0f);
		footer.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
		footer.getDefaultCell().setBorderWidthLeft(0f);
		footer.getDefaultCell().setBorderWidthRight(0f);
		footer.getDefaultCell().setBorderWidthBottom(0f);
		footer.getDefaultCell().setBorderWidthTop(0f);
		footer.getDefaultCell().setBorderColor(Color.GREEN);
			
		Image image = Image.getInstance("src/main/resources/images/report_image.jpg");
			
		contentcell.setImage(image);
		contentcell.setFixedHeight(70);
			
		contentcell.setPaddingBottom(0f);
		contentcell.setBorderWidthBottom(1f);
		contentcell.setBorderColorBottom(Color.CYAN);
			
		contentcell.setBorderWidthTop(0f);	
			
		contentcell.setPaddingLeft(leftBORDER);			
		contentcell.setBorderWidthLeft(leftBORDER);
			
		contentcell.setPaddingRight(0.0f);
		contentcell.setBorderWidthRight(rightBORDER);
		footer.addCell(contentcell);
		layout.addCell(footer);	
			
		PdfPCell disclaimer = null;
		String verbiage = "bla bla bla.";
		disclaimer = new PdfPCell(new Phrase( verbiage, pe.get10PointFont()));
		disclaimer.setBorder(Cell.NO_BORDER);
		layout.addCell(disclaimer);							

		document.add(layout);
			
	} catch (DocumentException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	}
	return document;
}


	private static PdfPCell setCellDisplayProperties(float fixedHeight, Phrase phrase) {
		PdfPCell cell2Display = new PdfPCell(phrase);
		cell2Display.setFixedHeight(fixedHeight);
		cell2Display.setBorderColor(borderCOLOR);
		cell2Display.setBorderWidthLeft(leftBORDER);
		cell2Display.setBorderWidthRight(rightBORDER);		
		cell2Display.setBorderWidthBottom(0f);
		cell2Display.setBorderWidthTop(0f);
		return cell2Display;
	}	
}

Open in new window

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE