开发者

Checkbox List in JDialog

I'm trying to use a JDialog box that has a search text field that as text is entered, it shortens a list to those that match. On this list I would like to display each line with a checkbox that can be selected. I might also want the开发者_如何学编程 ability for it to function like a select all list where Ctrl + Click on the line would select the item and check its box. How do I get this done?


Jlist is exactly what you're looking for. You can use a list of checkboxes and ctrl-click them.


I would use a JTable with two columns. The first column can be your check box and the second column could be the text.

Read the section from the Swing tutorial on "How to Use Tables" in particular the part on Sorting and Filtering for an example.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜