Because a thing seems difficult for you, do not think it impossible for anyone to accomplish. – Marcus Aurelius
Header

How do add a checkbox to items in a JList?

November 28th, 2011 | Posted by CcR in J2SE - (0 Comments)

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 CheckListExample
{
   public static void main(String args[])
   {
      JFrame Jframe = new JFrame();
      Jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      // Create a list containing … Read more