All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mdlaf.components.list.MaterialListCellRenderer Maven / Gradle / Ivy

There is a newer version: 1.1.4
Show newest version
package mdlaf.components.list;

import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.*;

/**
 * @author https://github.com/vincenzopalazzo
 */
class MaterialListCellRenderer extends DefaultListCellRenderer {


    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

        JLabel label = (JLabel) component;
        label.setBorder(UIManager.getBorder("List[item].border"));
        return component;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy