Chat Client emoticons window JAVA

This ListPanel might be a useful, as the DefaultListCellRenderer can display an Icon.

enter image description here

Icon icon = UIManager.getIcon("html.pendingImage");
...
@Override
public Component getListCellRendererComponent(JList list, Object
    value, int index, boolean isSelected, boolean cellHasFocus) {
    JLabel label =  (JLabel) super.getListCellRendererComponent(
        list, value, index, isSelected, cellHasFocus);
    label.setBorder(BorderFactory.createEmptyBorder(N, N, N, N));
    label.setIcon(icon);
    label.setHorizontalTextPosition(JLabel.CENTER);
    label.setVerticalTextPosition(JLabel.BOTTOM);
    return label;
}

Leave a Comment