How to make each index-instance of Label components in the ListCellRenderer have the same width?
I have a List , and in its ListCellRenderer class I put Labels to display "Labels" and data values.

The problem is that when there are more than one elements in the List then the Labels are not aligned , they do not have the same width. Although I used the following code but it does not do anything :

    public Component getListCellRendererComponent(List list, Object value, int index, boolean isSelected)
        {
            Content entry = null;
            Image thumb;
            int[] tLibImpayesLength = new int[list.size()];
            int maxDataLength;
            if (value instanceof Content)
                entry = (Content)value;
            if (entry != null)
            {
                if (showPhoto)
                {
                    thumb = createThumbnail(entry.getPhoto(), entry.getColumn(4));
                    pic.setIcon(thumb);
                }
                lData[0].setText(Formatage.nvl(entry.getColumn(1),"-"));
                lData[1].setText(Formatage.nvl(entry.getColumn(2),"-"));
                lData[2].setText(Formatage.nvl(entry.getColumn(3),"-")); // lData[2] is the Label which displays value at the right side of the Container , the others are at the above,left and do not cause any problem
    
                tLibImpayesLength[index] = lData[2].getText().length();
            }
            maxDataLength = Formatage.max(tLibImpayesLength);
            if (lData[2].getText().length() < maxDataLength)
            {
                lData[2].setPreferredW(maxDataLength);
            }
            list.repaint();
            return this;
        }

Here is the captured image in runtime :

![enter image description here][1]

When we look at the image then we see that the `Impayé (Ar)` Labels and the remaining value at their right are not aligned. So how to make them vertically aligned , or have the same width ?
  [1]: http://i.stack.imgur.com/CnhgL.png
How to make each index-instance of Label components in the ListCellRenderer have the same width?
===

I have a List , and in its ListCellRenderer class I put Labels to display "Labels" and data values.

The problem is that when there are more than one elements in the List then the Labels are not aligned , they do not have the same width. Although I used the following code but it does not do anything :

    public Component getListCellRendererComponent(List list, Object value, int index, boolean isSelected)
        {
            Content entry = null;
            Image thumb;
            int[] tLibImpayesLength = new int[list.size()];
            int maxDataLength;
            if (value instanceof Content)
                entry = (Content)value;
            if (entry != null)
            {
                if (showPhoto)
                {
                    thumb = createThumbnail(entry.getPhoto(), entry.getColumn(4));
                    pic.setIcon(thumb);
                }
                lData[0].setText(Formatage.nvl(entry.getColumn(1),"-"));
                lData[1].setText(Formatage.nvl(entry.getColumn(2),"-"));
                lData[2].setText(Formatage.nvl(entry.getColumn(3),"-")); // lData[2] is the Label which displays value at the right side of the Container , the others are at the above,left and do not cause any problem
    
                tLibImpayesLength[index] = lData[2].getText().length();
            }
            maxDataLength = Formatage.max(tLibImpayesLength);
            if (lData[2].getText().length() < maxDataLength)
            {
                lData[2].setPreferredW(maxDataLength);
            }
            list.repaint();
            return this;
        }

Here is the captured image in runtime :

![enter image description here][1]

When we look at the image then we see that the `Impayé (Ar)` Labels and the remaining value at their right are not aligned. So how to make them vertically aligned , or have the same width ?
  [1]: http://i.stack.imgur.com/CnhgL.png