This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
i want the example of Jtree with checkbox,first requirement is checkbox should be selected only when click on it not on label,and second requirement i want multiple checkbox be selected on mouse click on checkbox,any sloution shoud be apperciated
[ May 27, 2007: Message edited by: mahesh gaonkar ] [ May 27, 2007: Message edited by: mahesh gaonkar ]
I think you misunderstand what we do here at JavaRanch. We try to help people learn Java, not provide them with ready-made solutions to their problems. If you are stuck in your implementation, post the code you have so far, and indicate what it does or does not do. Then we can help you get going again.
"Selected" means whether or not this is the last node that the user clicked on with his/her mouse. Only one node can be "selected" at a time. When you check a different node, the previously-selected node gets unselected, and therefore unchecked. If you want selection to toggle between checked/unchecked, do this instead:
Or, if you're feeling particularly clever/devious: