开发者

JCheckBox to display and perform functionality in JList

I am trying to get a JCheckBox to display on a line that is in the multiple select JList and still 开发者_如何学Cperform its functionality.

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

Help/ideas?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜