FileDocCategorySizeDatePackage
MultiLineCellRenderer.javaAPI Docmp4parser 1.0-RC-171098Wed Dec 19 20:10:21 GMT 2012com.coremedia.iso.gui

MultiLineCellRenderer

public class MultiLineCellRenderer extends Object implements ListCellRenderer

Fields Summary
private JPanel
p
private JTextArea
ta
Constructors Summary
public MultiLineCellRenderer()

        p = new JPanel();
        p.setLayout(new BorderLayout());


        // text
        ta = new JTextArea();
        ta.setLineWrap(false);
        ta.setWrapStyleWord(true);
        p.add(ta, BorderLayout.CENTER);
    
Methods Summary
public java.awt.ComponentgetListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean hasFocus)


        ta.setText((String) value);
        int width = list.getWidth();
        // this is just to lure the ta's internal sizing mechanism into action
        if (width > 0)
            ta.setSize(width, Short.MAX_VALUE);
        return p;