private void printHeader(StringBuffer buf){ String classification = getClassification(); if (classification == null || classification.isEmpty()) return; // we can;t display this line since the classification is not there... buf.append("HEADER "); buf.append(classification); buf.append(" "); // fill up the white space to the right column int l = classification.length() + 10 ; while (l < 49){ l++; buf.append(" "); } Date d = getDepDate(); if ( d != null){ // provide correct display of Dep date... buf.append(dateFormat.format(d)); } else { buf.append(" "); } buf.append(" "); String id = getIdCode(); if ( id != null){ buf.append(getIdCode()); buf.append(" "); } else buf.append(" "); buf.append(newline); }