Author: tchemit Date: 2011-08-16 17:02:33 +0200 (Tue, 16 Aug 2011) New Revision: 3280 Url: http://chorem.org/repositories/revision/lima/3280 Log: improve renderer Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java 2011-08-16 14:51:21 UTC (rev 3279) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountRenderer.java 2011-08-16 15:02:33 UTC (rev 3280) @@ -28,7 +28,6 @@ import org.chorem.lima.entity.Account; import javax.swing.DefaultListCellRenderer; -import javax.swing.JLabel; import javax.swing.JList; import java.awt.Component; @@ -43,7 +42,6 @@ boolean isSelected, boolean cellHasFocus) { - JLabel label = new JLabel(); Account account = (Account) value; if (account != null) { String accountLabel = account.getLabel(); @@ -51,9 +49,9 @@ if (accountLabel != null && accountLabel.length() > nbChars) { accountLabel = accountLabel.substring(0, nbChars) + "…"; } - label.setText(account.getAccountNumber() + " - " + accountLabel); + setText(account.getAccountNumber() + " - " + accountLabel); } - return label; + return this; } }