开发者

Partial Selection in JTree using checkbox for every node

开发者 https://www.devze.com 2023-03-19 20:52 出处:网络
I have a application which uses a JTree. For each n开发者_Python百科ode in the tree, there is a checkbox attached to the node using a customized TreeCellRenderer. When some items of a node are selecte

I have a application which uses a JTree. For each n开发者_Python百科ode in the tree, there is a checkbox attached to the node using a customized TreeCellRenderer. When some items of a node are selected i.e not all children of a node are selected using the chechboxes, how do i indicate using the checkbox of the parent node that only a partial list of nodes is selected. For this, i need to draw a little square in the checkbox indicating that it is partially selected.


You can use e.g. http://www.roseindia.net/javatutorials/tristatecheckbox.shtml or http://www.javaspecialists.co.za/archive/Issue082.html

0

精彩评论

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