@Override public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus); TicketInfo tkt = (TicketInfo) value; int ticketType = tkt.getTicketType(); String sCustomer; if (tkt.getCustomer() == null) { sCustomer = ""; } else { sCustomer = tkt.getCustomer().getName(); } int ticketId = tkt.getTicketId(); Date date = tkt.getDate(); double total = tkt.getTotalPaid(); String name = tkt.getUser().getName(); String sHtml = "<tr><td width=\"30\">" + "[" + ticketId + "]" + "</td>" + "<td width=\"100\">" + Formats.TIMESTAMP.formatValue(date) + "</td>" + "<td align=\"center\" width=\"100\">" + sCustomer + "</td>" + "<td align=\"right\" width=\"100\">" + Formats.CURRENCY.formatValue(total) + "</td>" + "<td width=\"100\">" + Formats.STRING.formatValue(name) + "</td></tr>"; setText("<html><table>" + sHtml + "</table></html>"); switch (ticketType) { case TicketInfo.RECEIPT_NORMAL: setIcon(icoTicketNormal); break; case TicketInfo.RECEIPT_REFUND: setIcon(icoTicketRefund); break; case TicketInfo.RECEIPT_PAYMENT: setIcon(icoTicketDebt); break; } return this; }