import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.ListCellRenderer;
import javax.swing.ListSelectionModel;
public class Main {
public static void main(String args[]) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JList list = new JList(new CheckListItem[] { new CheckListItem("apple"),
new CheckListItem("orange"), new CheckListItem("mango"),
new CheckListItem("mango"),
new CheckListItem("mango"),
new CheckListItem("mango"),
new CheckListItem("mango"),
new CheckListItem("mango"),
new CheckListItem("mango"),
new CheckListItem("mango"),
new CheckListItem("mango"),
new CheckListItem("paw paw"), new CheckListItem("banana") });
list.setCellRenderer(new CheckListRenderer());
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent event) {