0

I am trying to get a JCheckBox to display on a line that is in the multiple select JList and still perform its functionality.

Right now if I add the JCheckBox as an element it just prints its toString format.

Help/ideas?

Bryan
  • 11
  • 2
  • You where given an answer to this question yesterday. Notice how you got the same answer again today. Quit wasting peoples time and post follow up comments stating what it is you don't understand instead of posting a new question. – camickr Jul 01 '10 at 05:39

1 Answers1

3

If you haven't already done so, you'll need to write a custom ListCellRenderer, as discussed in Writing a Custom Cell Renderer.

Addendum: Because you'll also need an editor to handle the checkbox state, you may find it easier to use a one column JTable, as discussed in How to Use Tables. Note that a data column having the type Boolean will be automatically rendered with a check box.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045